Skip to content

Commit aacf9df

Browse files
amazreechproject0
authored andcommitted
Merge pull request aws-actions#539 from lmller/patch-1
docs: make description for "service" parameter less ambiguous.
2 parents 3d96a3b + 2dcec82 commit aacf9df

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ inputs:
1111
description: 'The number of instantiations of the task to place and keep running in your service.'
1212
required: false
1313
service:
14-
description: 'The name of the ECS service to deploy to. The action will only register the task definition if no service is given.'
14+
description: 'The name of the ECS service to deploy to. If no service is given, the action will not deploy the task, but only register the task definition.'
1515
required: false
1616
cluster:
1717
description: "The name of the ECS service's cluster. Will default to the 'default' cluster"
@@ -34,6 +34,9 @@ inputs:
3434
codedeploy-deployment-description:
3535
description: "A description of the deployment, if the ECS service uses the CODE_DEPLOY deployment controller."
3636
required: false
37+
codedeploy-deployment-config:
38+
description: "The name of the AWS CodeDeploy deployment configuration, if the ECS service uses the CODE_DEPLOY deployment controller. If not specified, the value configured in the deployment group or `CodeDeployDefault.OneAtATime` is used as the default."
39+
required: false
3740
force-new-deployment:
3841
description: 'Whether to force a new deployment of the service. Valid value is "true". Will default to not force a new deployment.'
3942
required: false

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ async function createCodeDeployDeployment(codedeploy, clusterName, service, task
183183

184184
let codeDeployDescription = core.getInput('codedeploy-deployment-description', { required: false });
185185

186+
let codeDeployConfig = core.getInput('codedeploy-deployment-config', { required: false });
187+
186188
let deploymentGroupDetails = await codedeploy.getDeploymentGroup({
187189
applicationName: codeDeployApp,
188190
deploymentGroupName: codeDeployGroup
@@ -225,6 +227,9 @@ async function createCodeDeployDeployment(codedeploy, clusterName, service, task
225227
if (codeDeployDescription) {
226228
deploymentParams.description = codeDeployDescription
227229
}
230+
if (codeDeployConfig) {
231+
deploymentParams.deploymentConfigName = codeDeployConfig
232+
}
228233
const createDeployResponse = await codedeploy.createDeployment(deploymentParams);
229234
core.setOutput('codedeploy-deployment-id', createDeployResponse.deploymentId);
230235

index.test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ describe('Deploy to ECS', () => {
143143
failures: [],
144144
services: [{
145145
status: 'ACTIVE',
146-
deploymentController: {
146+
deploymentController: {
147147
type: 'ECS'
148148
}
149149
}]
@@ -763,7 +763,7 @@ describe('Deploy to ECS', () => {
763763
expect(waitUntilServicesStable).toHaveBeenCalledTimes(0);
764764
});
765765

766-
test('registers the task definition contents and creates a CodeDeploy deployment with custom application, deployment group and description', async () => {
766+
test('registers the task definition contents and creates a CodeDeploy deployment with custom application, deployment group, description and config', async () => {
767767
core.getInput = jest
768768
.fn(input => {
769769
return {
@@ -773,7 +773,8 @@ describe('Deploy to ECS', () => {
773773
'wait-for-service-stability': 'TRUE',
774774
'codedeploy-application': 'Custom-Application',
775775
'codedeploy-deployment-group': 'Custom-Deployment-Group',
776-
'codedeploy-deployment-description': 'Custom-Deployment'
776+
'codedeploy-deployment-description': 'Custom-Deployment',
777+
'codedeploy-deployment-config': 'CodeDeployDefault.AllAtOnce'
777778
}[input];
778779
});
779780

@@ -802,6 +803,7 @@ describe('Deploy to ECS', () => {
802803
expect(mockCodeDeployCreateDeployment).toHaveBeenNthCalledWith(1, {
803804
applicationName: 'Custom-Application',
804805
deploymentGroupName: 'Custom-Deployment-Group',
806+
deploymentConfigName: 'CodeDeployDefault.AllAtOnce',
805807
description: 'Custom-Deployment',
806808
revision: {
807809
revisionType: 'AppSpecContent',

0 commit comments

Comments
 (0)