From 7b62f7034198196a7a1a1a6b3cdbc3eb266b3f04 Mon Sep 17 00:00:00 2001 From: Tom Lei & Pablo Del Pino Date: Wed, 18 Dec 2019 14:05:54 -0800 Subject: [PATCH] Added the ability to use --cli-input-json to CodeDeploy deployment --- deployment/scripts/codeship_aws_codedeploy_deploy | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deployment/scripts/codeship_aws_codedeploy_deploy b/deployment/scripts/codeship_aws_codedeploy_deploy index 1f9a29b..93263a9 100755 --- a/deployment/scripts/codeship_aws_codedeploy_deploy +++ b/deployment/scripts/codeship_aws_codedeploy_deploy @@ -3,6 +3,8 @@ 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'} @@ -38,6 +40,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)