Unifying parameters for the 2 scale jobs

Change-Id: Idb413944146df4b648769d53751cdeaab73a7f38
diff --git a/jjb/voltha-scale.yaml b/jjb/voltha-scale.yaml
index d0c9795..c11be1c 100644
--- a/jjb/voltha-scale.yaml
+++ b/jjb/voltha-scale.yaml
@@ -266,68 +266,11 @@
           extraHelmFlags: '--set defaults.rw_core.timeout=30s '
 
 
-- job-template:
-    id: 'voltha-scale-measurements'
-    name: '{name}'
-    pipeline-script: 'voltha-scale-test.groovy'
-    disabled: '{disable-job}'
-
-    description: |
-      <!-- Managed by Jenkins Job Builder -->
-      Created by {id} job-template from ci-management/jjb/voltha-scale.yaml  <br /><br />
-      Using pipeline {pipeline-script} <br/><br/>
-      Scale measurements for VOLTHA 2.x
-
-    properties:
-      - cord-infra-properties:
-          build-days-to-keep: 30
-          artifact-num-to-keep: 15
-
-    wrappers:
-      - lf-infra-wrappers:
-          build-timeout: '{build-timeout}'
-          jenkins-ssh-credential: '{jenkins-ssh-credential}'
-
-    # default values
-    release: master
-
-    bbsimImg: voltha/bbsim:master
-    rwCoreImg: voltha/voltha-rw-core:master
-    ofAgentImg: voltha/voltha-ofagent-go:master
-    openoltAdapterImg:  voltha/voltha-openolt-adapter:master
-    openonuAdapterImg: voltha/voltha-openonu-adapter:master
-    onosImg: voltha/voltha-onos:master
-
-    bbsimChart: onf/bbsim
-    volthaChart: onf/voltha
-    openoltAdapterChart: onf/voltha-adapter-openolt
-    openonuAdapterChart: onf/voltha-adapter-openonu
-
-    olts: 2
-    pons: 2
-    onus: 2
-    workflow: att
-    withFlows: false
-    provisionSubscribers: false
-    withEapol: true
-    withDhcp: true
-    withIgmp: false
-    withLLDP: false
-    withMibTemplate: true
-    withMonitoring: true
-    withProfiling: false
-    withPcap: false
-    openonuAdapterReplicas: 1
-    onosReplicas: 1
-    atomixReplicas: 0
-    extraHelmFlags: ''
-    onosStatInterval: 5
-    volthaSystemTestsChange: ''
-    kindVolthaChange: ''
-    inMemoryEtcdStorage: true
-    karafHome: 'apache-karaf-4.2.9'
-    logLevel: 'WARN'
-
+# list of parameters for the VOLTHA Jobs,
+# used as anchor so that can be shared across multiple jobs
+# to use in a job: `parameters: *voltha-build-job-parameters`
+- voltha-scale-job-parameters: &voltha-scale-job-parameters
+    name: voltha-scale-job-parameters
     parameters:
       - string:
           name: release
@@ -509,6 +452,70 @@
           default: '{karafHome}'
           description: 'Karaf home'
 
+- job-template:
+    id: 'voltha-scale-measurements'
+    name: '{name}'
+    pipeline-script: 'voltha-scale-test.groovy'
+    disabled: '{disable-job}'
+
+    description: |
+      <!-- Managed by Jenkins Job Builder -->
+      Created by {id} job-template from ci-management/jjb/voltha-scale.yaml  <br /><br />
+      Using pipeline {pipeline-script} <br/><br/>
+      Scale measurements for VOLTHA 2.x
+
+    properties:
+      - cord-infra-properties:
+          build-days-to-keep: 30
+          artifact-num-to-keep: 15
+
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: '{build-timeout}'
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    # default values
+    release: master
+
+    bbsimImg: voltha/bbsim:master
+    rwCoreImg: voltha/voltha-rw-core:master
+    ofAgentImg: voltha/voltha-ofagent-go:master
+    openoltAdapterImg:  voltha/voltha-openolt-adapter:master
+    openonuAdapterImg: voltha/voltha-openonu-adapter:master
+    onosImg: voltha/voltha-onos:master
+
+    bbsimChart: onf/bbsim
+    volthaChart: onf/voltha
+    openoltAdapterChart: onf/voltha-adapter-openolt
+    openonuAdapterChart: onf/voltha-adapter-openonu
+
+    olts: 2
+    pons: 2
+    onus: 2
+    workflow: att
+    withFlows: false
+    provisionSubscribers: false
+    withEapol: true
+    withDhcp: true
+    withIgmp: false
+    withLLDP: false
+    withMibTemplate: true
+    withMonitoring: true
+    withProfiling: false
+    withPcap: false
+    openonuAdapterReplicas: 1
+    onosReplicas: 1
+    atomixReplicas: 0
+    extraHelmFlags: ''
+    onosStatInterval: 5
+    volthaSystemTestsChange: ''
+    kindVolthaChange: ''
+    inMemoryEtcdStorage: true
+    karafHome: 'apache-karaf-4.2.9'
+    logLevel: 'WARN'
+
+    <<: *voltha-scale-job-parameters
+
     project-type: pipeline
     concurrent: false
 
@@ -578,187 +585,9 @@
     kindVolthaChange: ''
     inMemoryEtcdStorage: true
     karafHome: 'apache-karaf-4.2.9'
+    logLevel: 'INFO'
 
-    parameters:
-      - string:
-          name: release
-          default: '{release}'
-          description: 'Version of the code to test (matches a branch in kind-voltha and voltha-system-tests repos)'
-
-      - string:
-          name: buildNode
-          default: '{build-node}'
-          description: 'Name of the Jenkins node to run the job on'
-
-      - string:
-          name: logLevel
-          default: 'WARN'
-          description: 'Log level for all the components'
-
-      - string:
-          name: onus
-          default: '{onus}'
-          description: 'Number of ONUs to provision'
-
-      - string:
-          name: pons
-          default: '{pons}'
-          description: 'Number of PONs to provision'
-
-      - string:
-          name: olts
-          default: '{olts}'
-          description: 'How many BBSim instances to run'
-
-      - string:
-          name: workflow
-          default: '{workflow}'
-          description: 'Which workflow are we testing (att, dt, tt)'
-
-      - bool:
-          name: withFlows
-          default: '{withFlows}'
-          description: 'Wheter to push flows from ONOS'
-
-      - bool:
-          name: provisionSubscribers
-          default: '{provisionSubscribers}'
-          description: 'Wheter to provision subscribers durint the tests'
-
-      - bool:
-          name: withEapol
-          default: '{withEapol}'
-          description: 'Wheter EAPOL is enabled for the test'
-
-      - bool:
-          name: withDhcp
-          default: '{withDhcp}'
-          description: 'Wheter DHCP is enabled for the test'
-
-      - bool:
-          name: withIgmp
-          default: '{withIgmp}'
-          description: 'Wheter IGMP is enabled for the test'
-
-      - bool:
-          name: withLLDP
-          default: '{withLLDP}'
-          description: 'Wheter Link Discovery is enabled for the test'
-
-      - bool:
-          name: withMibTemplate
-          default: '{withMibTemplate}'
-          description: 'Option to trigger MIB template command'
-
-      - bool:
-          name: withMonitoring
-          default: '{withMonitoring}'
-          description: 'Option to install Prometheus'
-
-      - bool:
-          name: withProfiling
-          default: '{withProfiling}'
-          description: 'Option to collect profiling informations from rw-core and openolt (note that the appropriate -profile images needs to be used)'
-
-      - bool:
-          name: withPcap
-          default: '{withPcap}'
-          description: 'Capture a .pcap on the OpenFlow connection from the ofAgent side'
-
-      - string:
-          name: extraHelmFlags
-          default: '{extraHelmFlags}'
-          description: 'Any extra helm parameters you want (passed to every helm install command, not available if release != master)'
-
-      - string:
-          name: openonuAdapterReplicas
-          default: '{openonuAdapterReplicas}'
-          description: 'How many OpenONU adapter instances to run'
-
-      - string:
-          name: onosReplicas
-          default: '{onosReplicas}'
-          description: 'How many ONOSes instances to run'
-
-      - string:
-          name: atomixReplicas
-          default: '{atomixReplicas}'
-          description: 'How many Atomix instances to run'
-
-      - string:
-          name: onosStatInterval
-          default: '{onosStatInterval}'
-          description: 'How often ONOS should poll for ports, flows and meters'
-
-      - string:
-          name: bbsimImg
-          default: '{bbsimImg}'
-          description: 'Custom image selection for BBSIM (repo:tag)'
-
-      - string:
-          name: bbsimChart
-          default: '{bbsimChart}'
-          description: 'BBSim chart name (or location on file system)'
-
-      - string:
-          name: rwCoreImg
-          default: '{rwCoreImg}'
-          description: 'Custom image selection for VOLTHA (repo:tag)'
-
-      - string:
-          name: ofAgentImg
-          default: '{ofAgentImg}'
-          description: 'Custom image selection for OfAgent (repo:tag), only supports the go version'
-
-      - string:
-          name: volthaChart
-          default: '{volthaChart}'
-          description: 'VOLTHA chart name (or location on file system)'
-
-      - string:
-          name: openoltAdapterImg
-          default: '{openoltAdapterImg}'
-          description: 'Custom image selection for Openolt Adapter (repo:tag)'
-
-      - string:
-          name: openoltAdapterChart
-          default: '{openoltAdapterChart}'
-          description: 'OpenOLT chart name (or location on file system)'
-
-      - string:
-          name: openonuAdapterImg
-          default: '{openonuAdapterImg}'
-          description: 'Custom image selection for Openonu Adapter (repo:tag)'
-
-      - string:
-          name: openonuAdapterChart
-          default: '{openonuAdapterChart}'
-          description: 'OpenONU chart name (or location on file system)'
-
-      - string:
-          name: onosImg
-          default: '{onosImg}'
-          description: 'Custom image selection for Openonu Adapter (repo:tag)'
-
-      - string:
-          name: volthaSystemTestsChange
-          default: '{volthaSystemTestsChange}'
-          description: 'Download a change for gerrit in the voltha-system-tests repo, example value: "refs/changes/79/18779/13"'
-
-      - string:
-          name: kindVolthaChange
-          default: '{kindVolthaChange}'
-          description: 'Download a change for gerrit in the kind-voltha repo, example value: "refs/changes/32/19132/1"'
-
-      - bool:
-          name: inMemoryEtcdStorage
-          default: '{inMemoryEtcdStorage}'
-          description: 'Whether to write ETCD keys on disk or keep them in memory (true=inMemory)'
-
-      - string:
-          name: karafHome
-          default: '{karafHome}'
-          description: 'Karaf home'
+    <<: *voltha-scale-job-parameters
 
     project-type: pipeline
     concurrent: false