Skip to content

Commit

Permalink
[Tools] Make deploy script able to update the lambda function with lo…
Browse files Browse the repository at this point in the history
…cal code.
  • Loading branch information
gmarciani committed May 10, 2024
1 parent bc4ffe8 commit 24511f6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ if [[ ! $(aws cloudformation describe-stacks --stack-name "$STACK_NAME" --region
CFN_DEPLOY_COMMAND="create-stack"
CFN_WAIT_COMMAND="stack-create-complete"
CFN_CLI_INPUT_YAML_FILE="$INFRASTRUCTURE_DIR/environments/$ENVIRONMENT-cfn-create-args.yaml"

UPDATE_LAMBDA="false"
else
info "The stack $STACK_NAME exists, updating ..."
CFN_DEPLOY_COMMAND="update-stack"
CFN_WAIT_COMMAND="stack-update-complete"
CFN_CLI_INPUT_YAML_FILE="$INFRASTRUCTURE_DIR/environments/$ENVIRONMENT-cfn-update-args.yaml"
UPDATE_LAMBDA="true"
fi

CLI_INPUT_YAML=$(sed "s#BUCKET_URL_PLACEHOLDER#$BUCKET_URL#g" "$CFN_CLI_INPUT_YAML_FILE")
Expand All @@ -112,6 +113,13 @@ aws cloudformation wait $CFN_WAIT_COMMAND \
--stack-name "$STACK_NAME" \
--region "$REGION"

info "Stack $STACK_NAME deployed"

if [[ $UPDATE_LAMBDA == "true" ]]; then
info "Updating Lambda ..."
bash "$CURRENT_DIR/build_and_update_lambda.sh" --stack-name "$STACK_NAME" --region "$REGION"
fi

info "Deployment completed!"
# -----------------------------

Expand Down

0 comments on commit 24511f6

Please sign in to comment.