From 08052bf8b8839f6e04aa4a57cfd9c2f72392be37 Mon Sep 17 00:00:00 2001 From: Vishal Gupta Date: Wed, 22 Jan 2025 16:45:08 +0530 Subject: [PATCH] Add git commit id as docker image tag (#1192) --- 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..0d185b7a76 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}', '-t', '${_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