Last active
June 20, 2018 00:11
-
-
Save candidosales/5454c5faaf67c628a04a8922f369ab2d to your computer and use it in GitHub Desktop.
Gitlab CI + App Engine
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: google/cloud-sdk:latest | |
stages: | |
- deploy | |
#################################################################################################### | |
# DEPLOY | |
# | |
.deploy_template: &deploy_template_def | |
stage: deploy | |
after_script: | |
- rm /tmp/$CI_PIPELINE_ID.json | |
deploy_staging: | |
<<: *deploy_template_def | |
environment: | |
name: staging | |
only: | |
- staging | |
script: | |
- echo $GOOGLE_APP_ENGINE_KEY_STAGING > /tmp/$CI_PIPELINE_ID.json | |
- gcloud auth activate-service-account --key-file /tmp/$CI_PIPELINE_ID.json | |
- gcloud config set project $GOOGLE_PROJECT_STAGING_ID | |
- gcloud info | |
- gcloud --quiet app deploy | |
deploy_production: | |
<<: *deploy_template_def | |
environment: | |
name: production | |
when: manual | |
only: | |
- master | |
script: | |
- echo $GOOGLE_APP_ENGINE_KEY_PRODUCTION > /tmp/$CI_PIPELINE_ID.json | |
- gcloud auth activate-service-account --key-file /tmp/$CI_PIPELINE_ID.json | |
- gcloud config set project $GOOGLE_PROJECT_PRODUCTION_ID | |
- gcloud info | |
- gcloud --quiet app deploy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment