]> granicus.if.org Git - graphviz/commitdiff
Push to git-SHA Docker image label
authorMark Hansen <markhansen@google.com>
Sat, 20 Feb 2021 03:44:31 +0000 (14:44 +1100)
committerMark Hansen <markhansen@google.com>
Sat, 20 Feb 2021 03:44:31 +0000 (14:44 +1100)
Keep the old image labels for backwards compatibility, just for now

Remove the filename scope: I want this to run every time we push, just
for now. We'll make this faster with caching soon.

.gitlab-ci.yml

index e90b431629b96f1268dfe087646d6d2011b5de74..001f1d5e07c87806fd6350fcb4ec096cda615f95 100644 (file)
@@ -581,13 +581,15 @@ deployment:
     - tags
   script:
     - cd ci/$IMAGE
-    - docker build -t $CI_REGISTRY/graphviz/graphviz:$IMAGE .
-    - docker push $CI_REGISTRY/graphviz/graphviz:$IMAGE
+    # Build and push with git commit SHA
+    - docker build -t $CI_REGISTRY/graphviz/graphviz/$IMAGE:$CI_COMMIT_SHA
+    - docker push     $CI_REGISTRY/graphviz/graphviz/$IMAGE:$CI_COMMIT_SHA
+    # Re-tag, backwards compatibility for the tests which are still using graphviz/graphviz:image-name
+    - docker tag $CI_REGISTRY/graphviz/graphviz/$IMAGE:$CI_COMMIT_SHA $CI_REGISTRY/graphviz/graphviz:$IMAGE
+    - docker push     $CI_REGISTRY/graphviz/graphviz:$IMAGE
   only:
     refs:
         - master@graphviz/graphviz
-    changes:
-      - ci/$IMAGE/Dockerfile
 
 docker_build_centos7:
   <<: *docker_build_definition