Merge "Update and simplify C jobs"
diff --git a/jjb/aaf/aaf-sshsm.yaml b/jjb/aaf/aaf-sshsm.yaml
index 6e4ab2e..31e7006 100644
--- a/jjb/aaf/aaf-sshsm.yaml
+++ b/jjb/aaf/aaf-sshsm.yaml
@@ -5,10 +5,10 @@
     build-timeout: 120
     project: 'aaf/sshsm'
     jobs:
-      - '{project-name}-{stream}-verify-c':
+      - gerrit-verify-c:
          script:
             !include-raw-escape: 'build-sshsm.sh'
-      - '{project-name}-{stream}-docker-c-shell-daily':
+      - gerrit-docker-c-shell-daily:
          script:
             !include-raw-escape: 'build-sshsm-docker-images.sh'
     stream:
diff --git a/jjb/global-templates-c.yaml b/jjb/global-templates-c.yaml
index 9f9bdf9..4669e82 100644
--- a/jjb/global-templates-c.yaml
+++ b/jjb/global-templates-c.yaml
@@ -1,5 +1,58 @@
 ---
-# vim: sw=2 ts=2 sts=2 et :
+####################
+# COMMON FUNCTIONS #
+####################
+
+- c_job_common: &c_job_common
+    name: c-job-common
+
+    ######################
+    # Default parameters #
+    ######################
+
+    branch: master
+    submodule-recursive: true
+    submodule-timeout: 10
+
+    #####################
+    # Job Configuration #
+    #####################
+
+    project-type: freestyle
+    node: '{build-node}'
+    disabled: false
+
+    properties:
+      - infra-properties:
+          build-days-to-keep: '{build-days-to-keep}'
+
+    parameters:
+      - lf-infra-parameters:
+          project: '{project}'
+          branch: '{branch}'
+          stream: '{stream}'
+
+    scm:
+      - lf-infra-gerrit-scm:
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+          git-url: '$GIT_URL/$PROJECT'
+          refspec: '$GERRIT_REFSPEC'
+          branch: '$GERRIT_BRANCH'
+          submodule-recursive: '{submodule-recursive}'
+          submodule-timeout: '{submodule-timeout}'
+          choosing-strategy: default
+
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: '{build-timeout}'
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    publishers:
+      - lf-infra-publish
+
+#################
+# JOB TEMPLATES #
+#################
 
 - job-template:
     #
@@ -8,33 +61,9 @@
     # Required Variables:
     #   script:         build script to execute
     #
-
     name: '{project-name}-{stream}-verify-c'
-    project-type: freestyle
-    node: '{build-node}'
-
-    properties:
-      - infra-properties:
-          build-days-to-keep: '{build-days-to-keep}'
-
-    parameters:
-      - infra-parameters:
-          project: '{project}'
-          branch: '{branch}'
-          refspec: 'refs/heads/{branch}'
-          artifacts: '{archive-artifacts}'
-      - maven-exec:
-          maven-version: '{maven-version}'
-
-    scm:
-      - gerrit-trigger-scm:
-          refspec: '$GERRIT_REFSPEC'
-          choosing-strategy: 'gerrit'
-          submodule-recursive: '{submodule-recursive}'
-
-    wrappers:
-      - infra-wrappers:
-          build-timeout: '{build-timeout}'
+    id: gerrit-verify-c
+    <<: *c_job_common
 
     triggers:
       - gerrit-trigger-patch-submitted:
@@ -47,11 +76,6 @@
       - lf-infra-pre-build
       - shell: '{script}'
 
-    publishers:
-      - infra-shiplogs:
-          maven-version: '{maven-version}'
-
-
 - job-template:
     # Job template for building & pushing docker images
     #
@@ -59,31 +83,10 @@
     #  1. login to the docker registry
     #  2. run a specified shell builder
     #
-
     name: '{project-name}-{stream}-docker-c-shell-daily'
-    project-type: freestyle
+    id: gerrit-docker-c-shell-daily
+    <<: *c_job_common
     node: 'ubuntu1604-docker-8c-8g'
-    disabled: false
-    properties:
-      - infra-properties:
-          build-days-to-keep: '{build-days-to-keep}'
-
-    parameters:
-      - infra-parameters:
-          project: '{project}'
-          branch: '{branch}'
-          refspec: 'refs/heads/{branch}'
-          artifacts: '{archive-artifacts}'
-
-    scm:
-      - gerrit-trigger-scm:
-          refspec: ''
-          choosing-strategy: 'default'
-          submodule-recursive: '{submodule-recursive}'
-
-    wrappers:
-      - infra-wrappers:
-          build-timeout: '{build-timeout}'
 
     triggers:
       # 12 AM UTC
@@ -100,7 +103,3 @@
           settings-file: '{mvn-settings}'
       - docker-login
       - shell: '{script}'
-
-    publishers:
-      - infra-shiplogs:
-          maven-version: '{maven-version}'