diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/package_transform.sh b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/package_transform.sh old mode 100644 new mode 100755 index 1861d671e..ff82e7398 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/package_transform.sh +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/package_transform.sh @@ -1,19 +1,41 @@ #!/bin/bash - -set -e - +# # This script will package all source code and send it to an S3 bucket in each region # where the lambda needs to be deployed to. # # ADF_PROJECT_NAME is an environment variable that is passed to the CodeBuild Project # CODEBUILD_SRC_DIR is an environment variable provided by CodeBuild +set -e + +SKIP_BUILD=0 + +# Walk through the options passed to this script +for i in "$@" +do + case $i in + --no-build) + SKIP_BUILD=1 + ;; + *) + echo "Unknown option: $i" + exit 1 + ;; + esac +done + pip install --upgrade awscli aws-sam-cli -q -# Build our template and its potential dependancies -sam build +if [[ $SKIP_BUILD == 0 ]]; then + echo "Perform build step" + # Build our template and its potential dependencies + sam build +else + echo "Skip build step" +fi # Get list of regions supported by this application +echo "Determine which regions need to be prepared" app_regions=`aws ssm get-parameters --names /deployment/$ADF_PROJECT_NAME/regions --with-decryption --output=text --query='Parameters[0].Value'` # Convert json list to bash list (space delimited regions) regions="`echo $app_regions | sed -e 's/\[\([^]]*\)\]/\1/g' | sed 's/,/ /g' | sed "s/'//g"`"