Skip to content

Instantly share code, notes, and snippets.

@AwolDes
Created December 23, 2017 06:18
Show Gist options
  • Select an option

  • Save AwolDes/65e2e88fb40ef0ed0bf185269396fbe1 to your computer and use it in GitHub Desktop.

Select an option

Save AwolDes/65e2e88fb40ef0ed0bf185269396fbe1 to your computer and use it in GitHub Desktop.
FILE="./.env"
if [[ $TRAVIS_BRANCH == 'staging' ]]; then
cat <<EOM >$FILE
REACT_APP_SOME_SERVICE=https://1111.execute-api.ap-southeast-2.amazonaws.com/dev
REACT_APP_OTHER_SERVICE=https://2222.execute-api.ap-southeast-2.amazonaws.com/dev
EOM
echo "=========== $TRAVIS_BRANCH ENV ==========="
cat $FILE
elif [[ $TRAVIS_BRANCH == 'master' ]]; then
cat <<EOM >$FILE
REACT_APP_SOME_SERVICE=https://1234.execute-api.ap-southeast-2.amazonaws.com/dev
REACT_APP_OTHER_SERVICE=https://1232.execute-api.ap-southeast-2.amazonaws.com/dev
EOM
echo "=========== $TRAVIS_BRANCH ENV ==========="
cat $FILE
else
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment