Cloud Build - Multiple Environments

149 views
Skip to first unread message

Bilal Haidar

unread,
Jun 9, 2021, 2:50:01 AM6/9/21
to Google App Engine

In my app, I have the following:

- app.yaml
- cloudbuild.yaml
---
I use the above for the first time to deploy the default service.

- app.qa.yaml
- cloudbuild_qa.yaml

- app.staging.yaml
- cloudbuild_staging.yaml

- app.prod.yaml
- cloudbuild_prod.yaml

They all reside at the root of the app.

For instance, the cloudbuild_qa.yaml is as follows:

steps:
  - name: node:14.0.0
    entrypoint: npm
    args: ['install']
  - name: node:14.0.0
    entrypoint: npm
    args: ['run', 'prod']
  - name: 'gcr.io/cloud-builders/gcloud'
    args: ['beta', 'app', 'deploy', '--project', '$PROJECT_ID', '-q', '$_GAE_PROMOTE', '--version', '$_GAE_VERSION', '--appyaml', 'app.qa.yaml']
timeout: '3600s'

The Cloud Build works well, however, it's not respecting the `app.qa.yaml` instead, it always takes the default `app.yaml`.

Any idea what's happening? Do you know how to use the correct app.yaml file in such a case?

Bilal Haidar

unread,
Jun 9, 2021, 2:52:38 AM6/9/21
to Google App Engine
This is what happens inside Cloud Build:

---
Services to deploy:

descriptor: [/workspace/app.yaml]
source: [/workspace]
target project: [test-project]
target service: [default]
target version: [qa]


Reply all
Reply to author
Forward
0 new messages