Skip to content

Commit

Permalink
feat(ci): Set environment variables based on branch
Browse files Browse the repository at this point in the history
  • Loading branch information
andreidmt committed Apr 2, 2021
1 parent d36b4cf commit e32a767
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,27 @@ jobs:
keys:
- tpl-react-{{ .Branch }}-{{ .Revision }}

# In every step, CircleCI uses bash to source BASH_ENV.
# This means that BASH_ENV is automatically loaded and run,
# allowing you to use interpolation and share environment
# variables across run steps.
- run:
name: "tpl-react: Configure env variables based on branch"
command: |
echo 'export VAR1=${GLOBAL_VAR1}' >> ${BASH_ENV}
if [ "${CIRCLE_BRANCH}" == "master" ]; then
echo '
export VAR2="${MASTER_VAR2}"
export VAR3="${MASTER_VAR3}"
' >> ${BASH_ENV}
fi
if [ "${CIRCLE_BRANCH}" == "dev" ]; then
echo '
export VAR2="${DEV_VAR2}"
export VAR3="${DEV_VAR3}"
' >> ${BASH_ENV}
fi
- run:
name: "tpl-react: GitHub release notes, CHANGELOG and package version"
command: "npm run release"
Expand Down

0 comments on commit e32a767

Please sign in to comment.