Skip to content

Instantly share code, notes, and snippets.

@bkdinoop
Forked from jghaines/aws-cloudformation.sh
Created October 15, 2017 19:59
Show Gist options
  • Save bkdinoop/b398ef765363f60efffbe1abe05f8a26 to your computer and use it in GitHub Desktop.
Save bkdinoop/b398ef765363f60efffbe1abe05f8a26 to your computer and use it in GitHub Desktop.
#!/bin/bash
# wrapper around "aws cloudformation" CLI to ignore certain pseudo-errors
# aws cloudformation deploy exits with 255 for "No changes to deploy" see: https://github.com/awslabs/serverless-application-model/issues/71
# this script exits with 0 for that case
STDERR=$(( aws cloudformation "$@" ) 2>&1)
ERROR_CODE=$?
echo ${STDERR} 1>&2
if [[ "${ERROR_CODE}" -eq "255" && "${STDERR}" =~ "No changes to deploy" ]]; then exit 0; fi
exit ${ERROR_CODE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment