From 1d5140188d51d5ab7d47b8e266f7775321753045 Mon Sep 17 00:00:00 2001
From: Sujen Shah <sujen.shah@jpl.nasa.gov>
Date: Tue, 6 Aug 2024 05:41:46 +0000
Subject: [PATCH] Update .gitlab-ci.yml to use CI_COMMIT_SHA

---
 .gitlab-ci.yml | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6245f37..577b11a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -21,12 +21,11 @@ docker-build:
   # Default branch leaves tag empty (= latest tag)
   # All other branches are tagged with the escaped branch name (commit ref slug)
   script:
-    - docker build --pull -t "$CI_REGISTRY_IMAGE${CI_COMMIT_BRANCH}" -f infiles_dps/dockerfile .
-    - docker push "$CI_REGISTRY_IMAGE${tag}"
+    - tag="$CI_COMMIT_SHA"
+    - docker build --pull -t "${CI_REGISTRY_IMAGE}:${tag}" .
+    - docker push "${CI_REGISTRY_IMAGE}:${tag}"
   # Run this job in a branch where a Dockerfile exists
   rules:
     - if: $CI_COMMIT_BRANCH
       exists:
-        - infiles_dps/dockerfile
-  tags:
-    - shell
\ No newline at end of file
+        - Dockerfile
-- 
GitLab