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.