Created
January 19, 2021 10:47
-
-
Save jgontrum/7ab1c6ed93f80412f6d64ab597b8572b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.deploy: | |
stage: Deployment | |
only: | |
- master | |
script: | |
- export CHANGES=$(git diff-tree --no-commit-id --compact-summary --name-only -r $CI_COMMIT_SHORT_SHA | grep -oE "^\\w+" | sort | uniq) | |
- export MATCH=$(echo "$CHANGES" | grep -e "^$CURRENT_PROJECT") | |
- | | |
if [[ ! -z "$MATCH" ]] | |
then | |
echo "Triggered deployment for $CURRENT_PROJECT"; | |
apk add --no-cache curl git python3 py3-pip "docker=19.03.5-r1"; | |
curl -Ls <https://cli.doppler.com/install.sh> | sh; | |
curl -sSL <https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py> | python -; | |
source $HOME/.poetry/env; | |
doppler run --command "sls config credentials --provider aws --key \\$AWS_ACCESS_KEY_ID --secret \\$AWS_SECRET_ACCESS_KEY"; | |
doppler run --command "cd $CURRENT_PROJECT && sls plugin install -n serverless-python-requirements && sls deploy"; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment