|
@@ -109,6 +109,7 @@ type PorterApp struct {
|
|
|
EnvGroups []string `yaml:"envGroups,omitempty"`
|
|
EnvGroups []string `yaml:"envGroups,omitempty"`
|
|
|
EfsStorage *EfsStorage `yaml:"efsStorage,omitempty"`
|
|
EfsStorage *EfsStorage `yaml:"efsStorage,omitempty"`
|
|
|
RequiredApps []RequiredApp `yaml:"requiredApps,omitempty"`
|
|
RequiredApps []RequiredApp `yaml:"requiredApps,omitempty"`
|
|
|
|
|
+ AutoRollback *AutoRollback `yaml:"autoRollback,omitempty"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// PorterAppWithAddons is the definition of a porter app in a Porter YAML file with addons
|
|
// PorterAppWithAddons is the definition of a porter app in a Porter YAML file with addons
|
|
@@ -144,6 +145,11 @@ type EfsStorage struct {
|
|
|
Enabled bool `yaml:"enabled"`
|
|
Enabled bool `yaml:"enabled"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// AutoRollback represents the auto rollback settings for a Porter app
|
|
|
|
|
+type AutoRollback struct {
|
|
|
|
|
+ Enabled bool `yaml:"enabled"`
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// Build represents the build settings for a Porter app
|
|
// Build represents the build settings for a Porter app
|
|
|
type Build struct {
|
|
type Build struct {
|
|
|
Context string `yaml:"context,omitempty" validate:"dir"`
|
|
Context string `yaml:"context,omitempty" validate:"dir"`
|
|
@@ -238,8 +244,6 @@ func ProtoFromApp(ctx context.Context, porterApp PorterApp) (*porterv1.PorterApp
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // service map is only needed for backwards compatibility at this time
|
|
|
|
|
- serviceMap := make(map[string]*porterv1.Service)
|
|
|
|
|
var services []*porterv1.Service
|
|
var services []*porterv1.Service
|
|
|
|
|
|
|
|
for _, service := range porterApp.Services {
|
|
for _, service := range porterApp.Services {
|
|
@@ -254,10 +258,8 @@ func ProtoFromApp(ctx context.Context, porterApp PorterApp) (*porterv1.PorterApp
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
services = append(services, serviceProto)
|
|
services = append(services, serviceProto)
|
|
|
- serviceMap[service.Name] = serviceProto
|
|
|
|
|
}
|
|
}
|
|
|
appProto.ServiceList = services
|
|
appProto.ServiceList = services
|
|
|
- appProto.Services = serviceMap // nolint:staticcheck // temporarily using deprecated field for backwards compatibility
|
|
|
|
|
|
|
|
|
|
if porterApp.Predeploy != nil {
|
|
if porterApp.Predeploy != nil {
|
|
|
predeployProto, err := serviceProtoFromConfig(*porterApp.Predeploy, porterv1.ServiceType_SERVICE_TYPE_JOB)
|
|
predeployProto, err := serviceProtoFromConfig(*porterApp.Predeploy, porterv1.ServiceType_SERVICE_TYPE_JOB)
|
|
@@ -280,6 +282,12 @@ func ProtoFromApp(ctx context.Context, porterApp PorterApp) (*porterv1.PorterApp
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if porterApp.AutoRollback != nil {
|
|
|
|
|
+ appProto.AutoRollback = &porterv1.AutoRollback{
|
|
|
|
|
+ Enabled: porterApp.AutoRollback.Enabled,
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
for _, requiredApp := range porterApp.RequiredApps {
|
|
for _, requiredApp := range porterApp.RequiredApps {
|
|
|
var targetIdentifier *porterv1.DeploymentTargetIdentifier
|
|
var targetIdentifier *porterv1.DeploymentTargetIdentifier
|
|
|
|
|
|
|
@@ -527,6 +535,12 @@ func AppFromProto(appProto *porterv1.PorterApp) (PorterApp, error) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if appProto.AutoRollback != nil {
|
|
|
|
|
+ porterApp.AutoRollback = &AutoRollback{
|
|
|
|
|
+ Enabled: appProto.AutoRollback.Enabled,
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return porterApp, nil
|
|
return porterApp, nil
|
|
|
}
|
|
}
|
|
|
|
|
|