Skip to content

add support for "--ignore-application-stop-failures" #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ Environment variables are used to control the deployment actions. A brief summar
| `AWS_CODE_DEPLOY_REVISION_DESCRIPTION` | No | A description that is stored within AWS Code Deploy that stores information about the specific revision |
| `AWS_CODE_DEPLOY_DEPLOYMENT_DESCRIPTION` | No | A description that is stored within AWS Code Deploy that stores information about the specific deployment |
| `AWS_CODE_DEPLOY_OUTPUT_STATUS_LIVE` | No | Boolean `true\|false` that specifies whether the deployment status should use a single line showing live status. In CI environments where the `\r` is not supported, set this to `false` for better logging. Default = `true` |
| `AWS_CODE_DEPLOY_IGNORE_APPLICATION_STOP_FAILURES` | No | Boolean `true\|false` that specifies whether ApplicatonStop failures should be ignored. Set this to `true` to ignore ApplicatonStop failures. Default = `false` |

## Examples

### CircleCI
Expand Down
8 changes: 7 additions & 1 deletion bin/aws-code-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,13 @@ runCommand "${REGISTER_APP_CMD}" \
# ----------------------
DEPLOYMENT_DESCRIPTION="$AWS_CODE_DEPLOY_DEPLOYMENT_DESCRIPTION"
h1 "Step 10: Creating Deployment"
DEPLOYMENT_CMD="aws deploy create-deployment --output json --application-name $APPLICATION_NAME --deployment-config-name $DEPLOYMENT_CONFIG_NAME --deployment-group-name $DEPLOYMENT_GROUP --s3-location $S3_LOCATION"

IGNORE_APPLICATION_STOP_FAILURES_SWITCH=""
if [ "true" == "${AWS_CODE_DEPLOY_IGNORE_APPLICATION_STOP_FAILURES}" ]; then
# https://docs.aws.amazon.com/codedeploy/latest/userguide/troubleshooting-deployments.html#troubleshooting-deployments-lifecycle-event-failures
IGNORE_APPLICATION_STOP_FAILURES_SWITCH="--ignore-application-stop-failures"
fi
DEPLOYMENT_CMD="aws deploy create-deployment $IGNORE_APPLICATION_STOP_FAILURES_SWITCH --output json --application-name $APPLICATION_NAME --deployment-config-name $DEPLOYMENT_CONFIG_NAME --deployment-group-name $DEPLOYMENT_GROUP --s3-location $S3_LOCATION"

if [ -n "$DEPLOYMENT_DESCRIPTION" ]; then
DEPLOYMENT_CMD="$DEPLOYMENT_CMD --description \"$DEPLOYMENT_DESCRIPTION\""
Expand Down