From 86a5efca5eb8bd9aa5f9cea4565d13d38f46e296 Mon Sep 17 00:00:00 2001 From: Vishal Gupta Date: Tue, 21 Jan 2025 05:37:49 +0000 Subject: [PATCH] Add git commit id as docker image tag --- import-automation/executor/cloudbuild.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/import-automation/executor/cloudbuild.yaml b/import-automation/executor/cloudbuild.yaml index 45b2a9f5af..7b010d43cd 100644 --- a/import-automation/executor/cloudbuild.yaml +++ b/import-automation/executor/cloudbuild.yaml @@ -7,12 +7,12 @@ steps: # Docker Build - name: 'gcr.io/cloud-builders/docker' - args: ['build', '-t', '${_DOCKER_IMAGE}:latest', '.'] + args: ['build', '-t', '${_DOCKER_IMAGE}:${COMMIT_SHA}', '${_DOCKER_IMAGE}:latest', '.'] dir: 'import-automation/executor' # Docker push to Google Artifact Registry - name: 'gcr.io/cloud-builders/docker' - args: ['push', '${_DOCKER_IMAGE}:latest'] + args: ['push', '${_DOCKER_IMAGE}', '--all-tags'] # Install dependencies - name: python:3.11.11 @@ -32,5 +32,5 @@ steps: args: - '-c' - | - docker tag ${_DOCKER_IMAGE}:latest ${_DOCKER_IMAGE}:stable \ - && docker push ${_DOCKER_IMAGE}:stable \ No newline at end of file + docker tag ${_DOCKER_IMAGE}:${COMMIT_SHA} ${_DOCKER_IMAGE}:stable \ + && docker push ${_DOCKER_IMAGE}:stable