diff --git a/docs/content/en/docs-dev/user-guide/configuration-reference.md b/docs/content/en/docs-dev/user-guide/configuration-reference.md index b3d67eee47..6f94c24137 100644 --- a/docs/content/en/docs-dev/user-guide/configuration-reference.md +++ b/docs/content/en/docs-dev/user-guide/configuration-reference.md @@ -445,6 +445,7 @@ One of `yamlField` or `regex` is required. | serviceDefinitionFile | string | The path ECS Service configuration file. Allow file in both `yaml` and `json` format. The default value is `service.json`. See [here](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service_definition_parameters.html) for parameters.| No | | taskDefinitionFile | string | The path to ECS TaskDefinition configuration file. Allow file in both `yaml` and `json` format. The default value is `taskdef.json`. See [here](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html) for parameters. | No | | targetGroups | [ECSTargetGroupInput](#ecstargetgroupinput) | The target groups configuration, will be used to routing traffic to created task sets. | Yes (if you want to perform progressive delivery) | +| runStandaloneTask | bool | Run standalone tasks during deployments. About standalone task, see [here](https://docs.aws.amazon.com/AmazonECS/latest/userguide/ecs_run_task-v2.html). The default value is `true`. | ### ECSTargetGroupInput diff --git a/docs/content/en/docs-v0.45.x/user-guide/configuration-reference.md b/docs/content/en/docs-v0.45.x/user-guide/configuration-reference.md index 1362f74d73..2c04c5b50e 100644 --- a/docs/content/en/docs-v0.45.x/user-guide/configuration-reference.md +++ b/docs/content/en/docs-v0.45.x/user-guide/configuration-reference.md @@ -445,6 +445,7 @@ One of `yamlField` or `regex` is required. | serviceDefinitionFile | string | The path ECS Service configuration file. Allow file in both `yaml` and `json` format. The default value is `service.json`. See [here](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service_definition_parameters.html) for parameters.| No | | taskDefinitionFile | string | The path to ECS TaskDefinition configuration file. Allow file in both `yaml` and `json` format. The default value is `taskdef.json`. See [here](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html) for parameters. | No | | targetGroups | [ECSTargetGroupInput](#ecstargetgroupinput) | The target groups configuration, will be used to routing traffic to created task sets. | Yes (if you want to perform progressive delivery) | +| runStandaloneTask | bool | Run standalone tasks during deployments. About standalone task, see [here](https://docs.aws.amazon.com/AmazonECS/latest/userguide/ecs_run_task-v2.html). The default value is `true`. | ### ECSTargetGroupInput diff --git a/pkg/app/piped/executor/ecs/ecs.go b/pkg/app/piped/executor/ecs/ecs.go index 1c6ec70007..ee025b5b21 100644 --- a/pkg/app/piped/executor/ecs/ecs.go +++ b/pkg/app/piped/executor/ecs/ecs.go @@ -199,6 +199,11 @@ func runStandaloneTask( return false } + if !*ecsInput.RunStandaloneTask { + in.LogPersister.Infof("Skipped running task") + return true + } + err = client.RunTask( ctx, *td, diff --git a/pkg/config/application_ecs.go b/pkg/config/application_ecs.go index 9ef8cb8c9c..fb0e5e72d3 100644 --- a/pkg/config/application_ecs.go +++ b/pkg/config/application_ecs.go @@ -54,6 +54,9 @@ type ECSDeploymentInput struct { // Automatically reverts all changes from all stages when one of them failed. // Default is true. AutoRollback *bool `json:"autoRollback,omitempty" default:"true"` + // Run standalone task during deployment. + // Default is true. + RunStandaloneTask *bool `json:"runStandaloneTask" default:"true"` } func (in *ECSDeploymentInput) IsStandaloneTask() bool { diff --git a/pkg/config/application_ecs_test.go b/pkg/config/application_ecs_test.go index a44c4288f1..2b63f733e1 100644 --- a/pkg/config/application_ecs_test.go +++ b/pkg/config/application_ecs_test.go @@ -61,8 +61,9 @@ func TestECSApplicationConfig(t *testing.T) { TargetGroups: ECSTargetGroups{ Primary: json.RawMessage(`{"containerName":"web","containerPort":80,"targetGroupArn":"arn:aws:elasticloadbalancing:xyz"}`), }, - LaunchType: "FARGATE", - AutoRollback: newBoolPointer(true), + LaunchType: "FARGATE", + AutoRollback: newBoolPointer(true), + RunStandaloneTask: newBoolPointer(true), }, }, expectedError: nil,