I know this has come up before, but now with circleCI 2.0 surely there must be an easier way to do this than having four env variables in the projects config and then doing this:
- deploy:
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
AWS_ACCESS_KEY_ID=${AWS_MASTER_KEY}
AWS_SECRET_ACCESS_KEY=${AWS_MASTER_SECRET}
serverless deploy --stage master
fi
if [ "${CIRCLE_BRANCH}" == "staging" ]; then
AWS_ACCESS_KEY_ID=${AWS_STAGING_KEY}
AWS_SECRET_ACCESS_KEY=${AWS_STAGING_SECRET}
serverless deploy --stage staging
fi
?