Skip to content
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

Add custom config json file #106

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions deployment/scripts/codeship_aws_codedeploy_deploy
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
set -e
set -o pipefail

# This script also uses an environment variable called CODEDEPLOY_CLI_INPUT_JSON which when supplied, it
# will be passed into the --cli-input-json argument for 'aws deploy create-deployment'
APPLICATION_FOLDER=${1:?'You need to provide the directory with your code as the second parameter'}
APPLICATION_NAME=${2:?'You need to provide the CodeDeploy application name'}
DEPLOYMENT_GROUP_NAME=${3:?'You need to provide the Deployment Group name'}
S3_BUCKET=${4:?'You need to provide the S3 Bucket to upload the artefact to'}
DEPLOYMENT_CONFIG_NAME=$5
CODEDEPLOY_CLI_INPUT_JSON=${6:? 'You need to provide the JSON file for custom overrides'}

source utils
S3_BUCKET_SUBFOLDER_PATH=$(s3_bucket_subfolder_path $S3_BUCKET)
Expand Down Expand Up @@ -38,6 +41,10 @@ if [ ! -z "$DEPLOYMENT_CONFIG_NAME" ]; then
deployment+=("--deployment-config-name" "$DEPLOYMENT_CONFIG_NAME")
fi

if [ ! -z "$CODEDEPLOY_CLI_INPUT_JSON" ]; then
deployment+=("--cli-input-json" "$CODEDEPLOY_CLI_INPUT_JSON")
fi

echo "Deployment Command: ${deployment[@]}"

deployment_id=$(aws deploy create-deployment "${deployment[@]}" | jq -r .deploymentId)
Expand Down
10 changes: 10 additions & 0 deletions deployment/scripts/custom_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"autoRollbackConfiguration": {
"enabled": true,
"events": [
"DEPLOYMENT_FAILURE"
]
},
"updateOutdatedInstancesOnly": true,
"fileExistsBehavior": "OVERWRITE"
}