Skip to content

Instantly share code, notes, and snippets.

@AstroTom
Last active May 23, 2018 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AstroTom/8ad3c69ecea3877fb72c35988be318f5 to your computer and use it in GitHub Desktop.
Save AstroTom/8ad3c69ecea3877fb72c35988be318f5 to your computer and use it in GitHub Desktop.
#
# sample property file
# illustrates more flexible way to define variables based on Environemnt
#
# Assume external variable $RNT_ENV
#
# current system
# only works for 3 environments
# addition of environmnt requires new code
# NOT recommended
case ENV in
PRD)
BUCKET=PRD_bucket
SNS-TOPIC=PRD_sns
DB=dbpg.PRD.app.wishtrip.com
;;
STG)
BUCKET=STG_bucket
SNS-TOPIC=STG_sns
DB=dbpg.STG.app.wishtrip.com
;;
DEV)
BUCKET=DEV_bucket
SNS-TOPIC=DEV_sns
DB=dbpg.DEV.app.wishtrip.com
;;
esac
#
# more flexible system
# works for any number of env
# Recommended method
#
BUCKET=${RNT_ENV}_bucket
SNS-TOPIC=${RNT_ENV}_sns
DB=dbpg.${RNT_ENV}.app.wishtrip.com
QNAME=${RNT_ENV}_name_q
DNS=host.${RNT_ENV}.app.wishtrip.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment