]> granicus.if.org Git - graphviz/commitdiff
No-op: consolidate Docker Image building YAML
authorMark Hansen <markhansen@google.com>
Sat, 20 Feb 2021 03:36:11 +0000 (14:36 +1100)
committerMark Hansen <markhansen@google.com>
Sat, 20 Feb 2021 03:36:58 +0000 (14:36 +1100)
This should have the same effect while making it easier to change the
common docker image building code.

.gitlab-ci.yml

index de72089805585b7987e57718b90f68b5b8baf9cb..e90b431629b96f1268dfe087646d6d2011b5de74 100644 (file)
@@ -579,87 +579,47 @@ deployment:
   # do not re-run this job for new Git tags of previously seen commits
   except:
     - tags
-
-docker_build_centos7:
-  <<: *docker_build_definition
   script:
-    - cd ci/centos7
-    - docker build -t $CI_REGISTRY/graphviz/graphviz:centos7 .
-    - docker push $CI_REGISTRY/graphviz/graphviz:centos7
+    - cd ci/$IMAGE
+    - docker build -t $CI_REGISTRY/graphviz/graphviz:$IMAGE .
+    - docker push $CI_REGISTRY/graphviz/graphviz:$IMAGE
   only:
     refs:
         - master@graphviz/graphviz
     changes:
-      - ci/centos7/Dockerfile
+      - ci/$IMAGE/Dockerfile
+
+docker_build_centos7:
+  <<: *docker_build_definition
+  variables:
+    IMAGE: centos7
 
 docker_build_centos8:
   <<: *docker_build_definition
-  script:
-    - cd ci/centos8
-    - docker build -t $CI_REGISTRY/graphviz/graphviz:centos8 .
-    - docker push $CI_REGISTRY/graphviz/graphviz:centos8
-  only:
-    refs:
-        - master@graphviz/graphviz
-    changes:
-      - ci/centos8/Dockerfile
+  variables:
+    IMAGE: centos8
 
 docker_build_fedora32:
   <<: *docker_build_definition
-  script:
-    - cd ci/fedora32
-    - docker build -t $CI_REGISTRY/graphviz/graphviz:fedora32 .
-    - docker push $CI_REGISTRY/graphviz/graphviz:fedora32
-  only:
-    refs:
-        - master@graphviz/graphviz
-    changes:
-      - ci/fedora32/Dockerfile
+  variables:
+    IMAGE: fedora32
 
 docker_build_fedora33:
   <<: *docker_build_definition
-  script:
-    - cd ci/fedora33
-    - docker build -t $CI_REGISTRY/graphviz/graphviz:fedora33 .
-    - docker push $CI_REGISTRY/graphviz/graphviz:fedora33
-  only:
-    refs:
-        - master@graphviz/graphviz
-    changes:
-      - ci/fedora33/Dockerfile
+  variables:
+    IMAGE: fedora33
 
 docker_build_ubuntu-18.04:
   <<: *docker_build_definition
-  script:
-    - cd ci/ubuntu-18.04
-    - docker build -t $CI_REGISTRY/graphviz/graphviz:ubuntu-18.04 .
-    - docker push $CI_REGISTRY/graphviz/graphviz:ubuntu-18.04
-  only:
-    refs:
-        - master@graphviz/graphviz
-    changes:
-      - ci/ubuntu-18.04/Dockerfile
+  variables:
+    IMAGE: ubuntu-18.04
 
 docker_build_ubuntu-20.04:
   <<: *docker_build_definition
-  script:
-    - cd ci/ubuntu-20.04
-    - docker build -t $CI_REGISTRY/graphviz/graphviz:ubuntu-20.04 .
-    - docker push $CI_REGISTRY/graphviz/graphviz:ubuntu-20.04
-  only:
-    refs:
-        - master@graphviz/graphviz
-    changes:
-      - ci/ubuntu-20.04/Dockerfile
+  variables:
+    IMAGE: ubuntu-20.04
 
 docker_build_ubuntu-20.10:
   <<: *docker_build_definition
-  script:
-    - cd ci/ubuntu-20.10
-    - docker build -t $CI_REGISTRY/graphviz/graphviz:ubuntu-20.10 .
-    - docker push $CI_REGISTRY/graphviz/graphviz:ubuntu-20.10
-  only:
-    refs:
-        - master@graphviz/graphviz
-    changes:
-      - ci/ubuntu-20.10/Dockerfile
+  variables:
+    IMAGE: ubuntu-20.10