Reduce redundancy in ci-management docker jobs 77/2477/3
authorLott, Christopher (cl778h) <cl778h@att.com>
Tue, 11 Feb 2020 19:43:40 +0000 (14:43 -0500)
committerLott, Christopher (cl778h) <cl778h@att.com>
Wed, 12 Feb 2020 19:55:16 +0000 (14:55 -0500)
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
Change-Id: I17ae9a83b551eb944178b5c664be1d93f52cd628

jjb/ci-management/ci-docker.yaml

index d2ce6e9..1c2274d 100644 (file)
@@ -1,6 +1,8 @@
 ---
+# Job configurations for base docker build images
+
+# This macro factors out common configuration
 - ci_docker_common: &ci_docker_common
-    # Defines common ci-docker configuration
     name: ci-docker-common
     # git repo
     project: ci-management
     cron: 'H H * * 6'
     # use host network to clone from our gerrit
     docker-build-args: '--network=host'
-    # default to YAML
+    # get tag from YAML
     container-tag-method: yaml-file
-    jobs:
-      - '{project-name}-gerrit-docker-jobs'
-    stream:
-      - master:
-          branch: master
-
-- project:
-    <<: *ci_docker_common
-    name: bldr-alpine3
+    # name key is overridden by project template
+    # Jenkins job prefix
     project-name: '{project}-{name}'
+    # Docker image name
     docker-name: '{name}'
+    # Directory with Dockerfile
     docker-root: 'docker/{name}'
+    # Limit build trigger to appropriate files
     gerrit_trigger_file_paths:
       - compare-type: REG_EXP
         pattern: 'docker/{name}/.*'
+    # Includes verify and merge jobs
     jobs:
       - '{project-name}-gerrit-docker-jobs'
+    # Only build master branch
+    stream:
+      - master:
+          branch: master
+
+# Each project name is a subdirectory in ci-management/docker
+# with a Dockerfile and a container-tag.yaml file
 
 - project:
+    name: bldr-alpine3
     <<: *ci_docker_common
-    name: bldr-ubuntu16-c-go
-    project-name: '{project}-{name}'
-    docker-name: '{name}'
-    docker-root: 'docker/{name}'
-    gerrit_trigger_file_paths:
-      - compare-type: REG_EXP
-        pattern: 'docker/{name}/.*'
 
 - project:
+    name: bldr-alpine3-go
     <<: *ci_docker_common
-    name: bldr-ubuntu18-c-go
-    project-name: '{project}-{name}'
-    docker-name: '{name}'
-    docker-root: 'docker/{name}'
-    gerrit_trigger_file_paths:
-      - compare-type: REG_EXP
-        pattern: 'docker/{name}/.*'
 
 - project:
+    name: bldr-ubuntu16-c-go
+    <<: *ci_docker_common
+
+- project:
+    name: bldr-ubuntu18-c-go
     <<: *ci_docker_common
-    name: bldr-alpine3-go
-    project-name: '{project}-{name}'
-    docker-name: '{name}'
-    docker-root: 'docker/{name}'
-    gerrit_trigger_file_paths:
-      - compare-type: REG_EXP
-        pattern: 'docker/{name}/.*'