I have set up a Trigger in Google Cloud Build to start a new pipeline when receiving a HTTP POST request.
The last pipeline in Build History has failed because there was problems with volumes in the yaml.
Now, I cannot start new pipelines using this Trigger. The webhook requests does receive HTTP 200 from Google, but no new pipeline is initiated.
How can I start a new pipeline from a webhook request, even when the last build failed? I use the inline-cloudbuild-yaml, to describe the pipeline.
This issue seem to be related to the Yaml description for the pipeline, but the big problem is that it does not show any error message - it just silently fail without initiating a new run.
Here is a simple inline-pipeline that works:
steps:
- name: 'ubuntu'
entrypoint: 'bash'
args:
- '-c'
- |
echo "Hello, world!"
and here is one that does not work, it is taken from the Cloud Build documentation for integrating with GitLab, but shortened to only two steps:
steps:
- name: gcr.io/cloud-builders/git
args:
- '-c'
- |
echo "$$SSHKEY" > /root/.ssh/id_rsa
chmod 400 /root/.ssh/id_rsa
ssh-keyscan gitlab.com > /root/.ssh/known_hosts
entrypoint: bash
secretEnv:
- SSHKEY
volumes:
- name: ssh
path: /root/.ssh
- name: gcr.io/cloud-builders/git
args:
- clone
- 'git@gitlab.com/<my-gitlab-repo>'
- .
volumes:
- name: ssh
path: /root/.ssh
availableSecrets:
secretManager:
- versionName: <my-path-to-secret-version>
env: SSHKEY
And the big problem is that no build is initiated, so no error message is shown.
In both cases, the Webhook request receives HTTP 200.