Skip to content

Instantly share code, notes, and snippets.

@jp9573
Created February 19, 2020 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jp9573/b599bf52d3ff2443f2740b827085e9e8 to your computer and use it in GitHub Desktop.
Save jp9573/b599bf52d3ff2443f2740b827085e9e8 to your computer and use it in GitHub Desktop.
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