Having this config on cloudbuild.yaml (there are other similar fragments on the file):
- name: 'gcr.io/cloud-builders/gcloud'
id: 'step_1'
args: ['builds',
'submit',
'--config=path_to_sub_app_1/app_1_build.yaml',
'--substitutions=VAR_1=${ENV_VAR_1}']
waitFor: ['Docker push']
- name: 'gcr.io/cloud-builders/gcloud'
id: 'step_2'
args: ['builds',
'submit',
'--config=path_to_sub_app_2/app_2_build.yaml',
'--substitutions=VAR_1=${ENV_VAR_1}']
waitFor: ['Docker push']
Is it possible to skip step_1 and continue the execution normally (step_2)?
Use entrypoint: 'bash':
- name: 'gcr.io/cloud-builders/gcloud'
id: 'step_1'
entrypoint: 'bash'
args:
- '-c'
- |
if [ "$_SKIP_STEP" != "true" ]
then
gcloud builds submit --config=path_to_sub_app_1/app_1_build.yaml --substitutions=VAR_1=${ENV_VAR_1}
fi
waitFor: ['Docker push']
Define this var: _SKIP_STEP="false"
And now we can run the build and skip step_1:
gcloud builds submit --config=cloudbuild.yaml --substitutions=_SKIP_STEP=true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With