Extract common job attributes in default job definition

Change-Id: Ifc6a2dee273effb6a83d2bdd6d4623942bd59f9f
diff --git a/jenkins/gerrit-bazel-template.yaml b/jenkins/gerrit-bazel-template.yaml
index caaf123..16a77cf 100644
--- a/jenkins/gerrit-bazel-template.yaml
+++ b/jenkins/gerrit-bazel-template.yaml
@@ -1,3 +1,42 @@
+- defaults:
+    name: gerrit-bazel-defaults
+    node: bazel-debian
+    properties:
+       - build-discarder:
+           days-to-keep: 20
+           artifact-days-to-keep: 20
+       - authorization:
+           anonymous:
+             - job-discover
+             - job-read
+             - job-extended-read
+    scm:
+      - git:
+         url: https://gerrit.googlesource.com/gerrit
+         branches:
+           - origin/{branch}
+         submodule:
+           recursive: true
+         skip-tag: true
+         basedir: gerrit
+
+    builders:
+      - shell:
+         !include-raw: gerrit-bazel-build.sh
+      - shell:
+         !include-raw: gerrit-bazel-test.sh
+      - shell:
+         !include-raw-escape: gerrit-bazel-cat-test-log.sh
+      - shell:
+         !include-raw: gerrit-deploy-api.sh
+    publishers:
+      - archive:
+         artifacts: >
+           gerrit/bazel-bin/*.war,gerrit/bazel-bin/plugins/*/*.jar,
+           gerrit/bazel-bin/*api/*api.jar,
+           gerrit/bazel-bin/gerrit-acceptance-framework/*.jar
+         excludes: 'gerrit/bazel-bin/plugins/core*/**/*.jar'
+
 - job-template:
     name: 'Gerrit-{branch}'
     project-type: flow
@@ -35,6 +74,7 @@
 - job-template:
     name: 'Gerrit-bazel-{branch}'
     description: "{name} {branch} branch build with Bazel\n"
+    defaults: gerrit-bazel-defaults
     node: bazel-debian
     wrappers:
       - timeout:
@@ -53,42 +93,6 @@
           shutdown-with-build: false
       - raw:
           xml: <jenkins.plugins.logstash.LogstashBuildWrapper plugin="logstash@1.2.0"/>
-    properties:
-       - build-discarder:
-           days-to-keep: 20
-           artifact-days-to-keep: 20
-       - authorization:
-           anonymous:
-             - job-discover
-             - job-read
-             - job-extended-read
-    scm:
-      - git:
-         url: https://gerrit.googlesource.com/gerrit
-         branches:
-           - origin/{branch}
-         submodule:
-           recursive: true
-         skip-tag: true
-         basedir: gerrit
-
-    builders:
-      - shell:
-         !include-raw: gerrit-bazel-build.sh
-      - shell:
-         !include-raw: gerrit-bazel-test.sh
-      - shell:
-         !include-raw-escape: gerrit-bazel-cat-test-log.sh
-      - shell:
-         !include-raw: gerrit-deploy-api.sh
-    publishers:
-      - archive:
-         artifacts: >
-           gerrit/bazel-bin/*.war,gerrit/bazel-bin/plugins/*/*.jar,
-           gerrit/bazel-bin/*api/*api.jar,
-           gerrit/bazel-bin/gerrit-acceptance-framework/*.jar
-
-         excludes: 'gerrit/bazel-bin/plugins/core*/**/*.jar'
 
 - project:
     name: Gerrit-bazel