Created
February 19, 2020 12:51
-
-
Save jp9573/b599bf52d3ff2443f2740b827085e9e8 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
image: python:3.7 | |
test: | |
script: | |
- pip install coverage | |
- coverage run test_operation.py | |
- coverage report -m | |
only: | |
- master | |
production: | |
stage: deploy | |
script: | |
# install google cloud sdk & configure service account | |
- echo "deb http://packages.cloud.google.com/apt cloud-sdk-jessie main" | tee /etc/apt/sources.list.d/google-cloud-sdk.list | |
- curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | |
- apt-get update -qy | |
- apt-get install -y google-cloud-sdk | |
- echo $SERVICE_ACCOUNT > /tmp/$CI_PIPELINE_ID.json | |
# write credentials before deployment | |
- touch MY_AWS_SERVICES_CREDENTIALS.json | |
- echo $AWS_SERVICES_CREDENTIALS > MY_AWS_SERVICES_CREDENTIALS.json | |
# deploy all the files to cloud | |
- gcloud auth activate-service-account --key-file /tmp/$CI_PIPELINE_ID.json | |
- gcloud --quiet --project $PROJECT_ID app deploy app.yaml -v master | |
only: | |
- master | |
after_script: | |
- rm /tmp/$CI_PIPELINE_ID.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment