Last active
August 9, 2020 15:46
-
-
Save DanielDaCosta/84bf3566d97738b7d368a8ef52e2f8af to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| image: "python:3.7" | |
| .packages: &package | |
| stage: deploy | |
| before_script: | |
| - apt-get update -y | |
| - apt-get install zip | |
| - pip install awscli | |
| - pip install -r lambda/requirements.txt -t /lambda/package | |
| stages: | |
| - build | |
| - deploy | |
| flake8: | |
| stage: build | |
| before_script: | |
| - python --version | |
| - pip install flake8 | |
| script: | |
| - flake8 lambda/*.py --count --select=E9,F63,F7,F82 --show-source --statistics --exclude __pycache__,./lambda/package/* | |
| only: | |
| - develop | |
| - master | |
| dev: | |
| <<: *package | |
| variables: | |
| AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_DEV | |
| AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_DEV | |
| S3_BUCKET_NAME: $S3_BUCKET_NAME_DEV | |
| script: | |
| - cd lambda | |
| - zip -r $CI_PROJECT_NAME.zip . | |
| - aws s3 cp $CI_PROJECT_NAME.zip s3://$S3_BUCKET_NAME/$CI_PROJECT_NAME.zip | |
| only: | |
| - master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment