I have this pipeline which is supposed to be updated once a push is done. Here's the cloudbuild.yaml file that should build the new code and deploy to the pipeline:
# Build and tag Docker images
- name: 'gcr.io/k8s-skaffold/pack'
entrypoint: 'pack'
args:
[
"build", "--builder=gcr.io/buildpacks/builder", "--publish", "us-central1-docker.pkg.dev/my-project/docker-repo/my-project-staging:$SHORT_SHA", "--env=GOOGLE_ENTRYPOINT=flask run"
]
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: gcloud
args:
[
"deploy", "releases", "create", "release-${SHORT_SHA}",
"--delivery-pipeline", "staging-pipeline",
"--region", "us-central1",
"--annotations", "commitId=${REVISION_ID}",
"--images", "staging-image=us-central1-docker.pkg.dev/my-project/docker-repo/my-project-staging:$SHORT_SHA"
]
Solved! Go to Solution.
According to this documentation, SHORT_SHA is always referenced to the first seven characters of COMMIT_SHA. I would suggest to properly configure your substitute variables or manually provide a value to it.
Hi @alexandre-br ,
Just to confirm, you want to replace the previous release on your pipeline? What's the reason why you don't want to create a new release version instead of replacing the previous one?
Hi @marcanthonyb , I actually want to create a new release, but the error suggests it already exists (which is odd, since the release's name is created by a ${SHORT_SHA} value, so it shouldn't exist).
According to this documentation, SHORT_SHA is always referenced to the first seven characters of COMMIT_SHA. I would suggest to properly configure your substitute variables or manually provide a value to it.