[ONOS-7346] ver.a

Change-Id: I6bb4eca314034dcf56b2b51160ecf9efaa423aaa
diff --git a/jjb/OnosSystemTest/onos-test-pipeline.yaml b/jjb/OnosSystemTest/onos-test-pipeline.yaml
index 1509eca..f7b06a8 100644
--- a/jjb/OnosSystemTest/onos-test-pipeline.yaml
+++ b/jjb/OnosSystemTest/onos-test-pipeline.yaml
@@ -1,6 +1,8 @@
 ---
 # ONOS System Test Pipeline jobs
 
+# TODO: for some reason, lf-* types of macro cannot access to the variable. I think it is typical problem to pipeline job type.
+
 - var-init-boiler-plate: &var-init-boiler-plate
     name: var-init-boiler-plate
     FUNC: "FUNCgroup\nFUNCflow\nFUNCintent\nFUNCintentRest\nFUNCipv6Intent\nFUNCnetCfg\nFUNCnetconf\nFUNCoptical\nFUNCovsdbtest\nFUNCformCluster"
@@ -20,21 +22,35 @@
       - build-discarder:
          num-to-keep: 20
 
+- init-procedure-plate: &init-procedure-plate
+    name: init-procedure-plate
+    project: OnosSystemTest
+    stream: 'master'
+    jenkins-path: 'TestON/JenkinsFile'
+
+- job-version-plate: &job-version-plate
+    name: job-version-plate
+    version:
+      - '1.11'
+      - '1.12'
+      - 'master'
+      - 'manually'
+
+- job-type-plate: &job-type-plate
+    name: job-type-plate
+    type:
+      - 'FUNC'
+      - 'HA'
+      - 'SCPF'
+      - 'USECASE'
+
 - job-template:
     name: all-pipeline-trigger
 
     <<: *var-init-boiler-plate
     <<: *job-boiler-plate
-    jvmPre: "${{"
-    jvmHeap: JAVA_OPTS:--Xms8G -Xmx8G
-    jvmEnd: "}}"
-    parameters:
 
-      - lf-infra-parameters:
-        project: '{project}'
-        branch: '{stream}'
-        stream: '{stream}'
-        lftools-version: '{lftools-version}'
+    parameters:
 
       - bool:
          name: manual_run
@@ -68,14 +84,24 @@
 
       - string:
          name: ONOSJVMHeap
-         default: "${{JAVA_OPTS:--Xms8G -Xmx8G}}"
+         default: "\"${{JAVA_OPTS:--Xms8G -Xmx8G}}\""
          description: 'ONOS cell JVM heap size setting.'
 
       - text:
          name: Tests
-         default: '{FUNC}\n{HA}\n{SCPF}\n{USECASE}'
+         default: |
+                   {FUNC}
+                   {HA}
+                   {SCPF}
+                   {USECASE}
          description: 'Specify the tests you want to run, if manual_run is selected.'
 
+      - lf-infra-parameters:
+         project: 'OnosSystemTest'
+         branch: 'master'
+         stream: 'master'
+         lftools-version: '<1.0.0'
+
     concurrent: false
 
     triggers:
@@ -84,7 +110,139 @@
                 30 11 * * 6,7
 
     pipeline-scm:
-      script-path: TestON/JenkinsFile/JenkinsfileTrigger
+      script-path: '{jenkins-path}/JenkinsfileTrigger'
+      scm:
+        - git:
+           url: '$GIT_URL/$GERRIT_PROJECT'
+           credentials-id: '{jenkins-ssh-credential}'
+           branches:
+             - 'master'
+
+- job-template:
+    name: '{type}-pipeline-{version}'
+
+    <<: *job-boiler-plate
+
+    parameters:
+
+      - string:
+         name: TRIGGER_ONLY_WHEN_PREVIOUS_JOB_WAS_BUILT_HERE
+         default: 'DO_NOT_MANUALLY_TRIGGER_A_BUILD_HERE'
+         description: |
+                       <a href=https://onos-jenkins.onlab.us/job/ALL_Pipeline_Trigger/>ALL_Pipeline_Trigger</a> triggers this pipeline automatically.
+
+      - lf-infra-parameters:
+         project: 'OnosSystemTest'
+         branch: 'master'
+         stream: 'master'
+         lftools-version: '<1.0.0'
+
+    concurrent: false
+
+    pipeline-scm:
+      script-path: '{jenkins-path}/{type}JenkinsFile'
+      scm:
+        - git:
+           url: '$GIT_URL/$GERRIT_PROJECT'
+           credentials-id: '{jenkins-ssh-credential}'
+           branches:
+             - 'master'
+
+- job-template:
+    name: 'manual-graph-generator-SCPF'
+
+    <<: *var-init-boiler-plate
+    <<: *job-boiler-plate
+
+    parameters:
+
+      - lf-infra-parameters:
+         project: 'OnosSystemTest'
+         branch: 'master'
+         stream: 'master'
+         lftools-version: '<1.0.0'
+
+      - choice:
+         name: ONOSbranch
+         choices:
+           - 'master'
+           - 'onos-1.12'
+           - 'onos-1.11'
+         description: "Possible branches (may vary depending on test)"
+
+      - bool:
+         name: isOldFlows
+         default: false
+         description: 'Check if it is using the old flow rules'
+
+      - text:
+         name: Test
+         default: '{SCPF}'
+         description: 'List of the tests to generate.'
+
+      - lf-infra-parameters:
+         project: 'OnosSystemTest'
+         branch: 'master'
+         stream: 'master'
+         lftools-version: '<1.0.0'
+
+    pipeline-scm:
+      script-path: '{jenkins-path}/SCPF_Graph_Generator'
+      scm:
+        - git:
+           url: '$GIT_URL/$GERRIT_PROJECT'
+           credentials-id: '{jenkins-ssh-credential}'
+           branches:
+             - 'master'
+
+- job-template:
+    name: 'manual-graph-generator-trend'
+
+    <<: *var-init-boiler-plate
+    <<: *job-boiler-plate
+
+    parameters:
+
+      - choice:
+         name: ONOSbranch
+         choices:
+           - 'master'
+           - 'onos-1.12'
+           - 'onos-1.11'
+         description: "Possible branches (may vary depending on test)"
+
+      - choice:
+         name: NodeCluster
+         choices:
+           - VM
+           - BM
+         description: |
+                       Node cluster where the test graphs in the list are located.
+                       List of the tests will be refreshed depends on the node cluster.
+
+      - text:
+         name: Test
+         default: |
+                   VM:
+                   {FUNC}
+                   {HA}
+                   BM:
+                   {USECASE}
+         description: 'List of the tests to generate.'
+
+      - string:
+         name: Builds
+         deafult: 20
+         description: 'Builds to show in the graph.'
+
+      - lf-infra-parameters:
+         project: 'OnosSystemTest'
+         branch: 'master'
+         stream: 'master'
+         lftools-version: '<1.0.0'
+
+    pipeline-scm:
+      script-path: '{jenkins-path}/Trend_Graph_Generator'
       scm:
         - git:
            url: '$GIT_URL/$GERRIT_PROJECT'
@@ -95,9 +253,34 @@
 - project:
     name: all-pipeline-trigger
     project-name: all-pipeline-trigger
-    project: OnosSystemTest
-    stream: 'master'
+
+    <<: *init-procedure-plate
+
     # can we use this node or master ?
     build-node: 'ubuntu16.04-basebuild-8c-15g'
     jobs:
       - 'all-pipeline-trigger'
+
+- project:
+    name: build-pipeline
+
+    <<: *job-type-plate
+
+    project-name: '{type}-pipeline'
+
+    <<: *init-procedure-plate
+    <<: *job-version-plate
+
+    jobs:
+      - '{type}-pipeline-{version}'
+
+- project:
+    name: graph-generator
+
+    project-name: 'graph-generator'
+
+    <<: *init-procedure-plate
+
+    jobs:
+      - 'manual-graph-generator-SCPF'
+      - 'manual-graph-generator-trend'