Skip to content

Instantly share code, notes, and snippets.

@jgontrum
Created January 19, 2021 10:47
Show Gist options
  • Save jgontrum/7ab1c6ed93f80412f6d64ab597b8572b to your computer and use it in GitHub Desktop.
Save jgontrum/7ab1c6ed93f80412f6d64ab597b8572b to your computer and use it in GitHub Desktop.
.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