Add unified merge PoC job templates 51/115051/9
authorLasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>
Wed, 18 Nov 2020 17:47:24 +0000 (19:47 +0200)
committerLasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>
Fri, 20 Nov 2020 16:03:56 +0000 (18:03 +0200)
 - add PoC templates for unified merge and docker image STAGING jobs
   - unified merge job is triggered by merge submit trigger
   - the triggered docker build and CSIT are based on master
 - use the templates in music
 - restore the original {project-name}-{stream}-docker-golang-shell-daily
   music job
 - remove unsupported "condition" parameters from trigger-jobs
 - change project-specific CSIT to a single job that triggers all the
   plans under the project
 - change snapshot docker build to a single job that is named by
   artifact type (in music's case golang)
 - these changes should not be applied before integration/csit commit
   https://gerrit.onap.org/r/c/integration/csit/+/115170 is merged!

Issue-ID: INT-1783
Signed-off-by: Lasse Kaihlavirta <l.kaihlavirt@partner.samsung.com>
Change-Id: If838b264a82069504817bcf2612011c33e3d26f2

jjb/global-templates-docker.yaml
jjb/global-templates-golang.yaml
jjb/integration/integration-macros.yaml
jjb/integration/integration-templates-csit.yaml
jjb/music/music-distributed-kv-store-csit.yaml
jjb/music/music-distributed-kv-store.yaml
jjb/music/tag-music-distributed-kv-store-image-staging.sh [new file with mode: 0755]

index 8b243b6..309a7c7 100644 (file)
               predefined-parameters: |
                 PARENT_JOB_NAME=$JOB_NAME
                 DOCKERHUB_REGISTRY=docker.io
+
+- job-template:
+    # Job template PoC for tagging snapshot docker images
+    # identified by given unique tag as STAGING
+    # The purpose of this job template is to run:
+    #  1. login to the docker registry
+    #  2. run a specified shell builder for tagging
+    #
+
+    name: '{project-name}-{stream}-docker-staging-PoC'
+    project-type: freestyle
+    node: 'ubuntu1804-docker-8c-8g'
+    disabled: '{disabled}'
+    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}'
+      - integration-unique-docker-tag:
+          unique-docker-tag: ''
+    scm:
+      - gerrit-trigger-scm:
+          refspec: '$GERRIT_REFSPEC'
+          choosing-strategy: 'gerrit'
+          submodule-recursive: '{submodule-recursive}'
+
+    wrappers:
+      - infra-wrappers:
+          build-timeout: '{build-timeout}'
+
+    builders:
+      - lf-infra-pre-build
+      - provide-maven-settings:
+          global-settings-file: 'global-settings'
+          settings-file: '{mvn-settings}'
+
+      - docker-login
+
+      - shell: '{script}'
+
+    publishers:
+      - infra-shiplogs:
+          maven-version: '{maven-version}'
+
index b3b460f..9e45a76 100644 (file)
     #  2. run a specified shell builder
     #
 
-    name: '{project-name}-{stream}-docker-golang-snapshot-PoC'
+    name: '{project-name}-{stream}-golang-docker-snapshot-PoC'
     golangver: 'golang110'
     project-type: freestyle
     node: 'ubuntu1804-docker-8c-8g'
index b472846..918d67c 100644 (file)
@@ -70,7 +70,7 @@
 - builder:
     name: integration-run-project-test
     builders:
-      - shell: "${WORKSPACE}/csit/run-project-csit.sh ${TESTPLAN} ${TESTOPTIONS}"
+      - shell: "${WORKSPACE}/csit/run-project-csit.sh ${TESTOPTIONS}"
 
 - builder:
     name: integration-autorelease-fix-relativepaths
     publishers:
       - robot:
           output-path: 'archives'
+          output-xml: '**/output.xml'
+          report-html: '**/report.html'
+          log-html: '**/log.html'
           other-files: ''
           unstable-threshold: '{unstable-if}'
           pass-threshold: '{pass-if}'
     publishers:
       - robot:
           output-path: 'csit/archives'
+          output-xml: '**/output.xml'
+          report-html: '**/report.html'
+          log-html: '**/log.html'
           other-files: ''
           unstable-threshold: '{unstable-if}'
           pass-threshold: '{pass-if}'
index 804598c..f538046 100644 (file)
           send-to-individuals: true
 
 - job-template:
-    name: '{project-name}-{stream}-project-csit-{functionality}-PoC'
+    name: '{project-name}-{stream}-project-csit-PoC'
     disabled: '{disabled}'
     project-type: freestyle
     build-node: 'ubuntu1804-docker-8c-8g'
           branch: '{branch}'
           refspec: 'refs/heads/{branch}'
           artifacts: '{archive-artifacts}'
-      - integration-test-plan:
-          test-plan: 'plans/{functionality}'
       - integration-test-options:
           test-options: '{robot-options}'
       - integration-unique-docker-tag:
           global-settings-file: "{mvn-global-settings}"
           settings-file: "{mvn-settings}"
       - trigger-builds:
-         -  project: "{project-name}-{stream}-docker-golang-snapshot-PoC"
-            condition: UNSTABLE_OR_BETTER
+         -  project: "{project-name}-{stream}-{artifact-type}-docker-snapshot-PoC"
             predefined-parameters: |
               UNIQUE_DOCKER_TAG=$BUILD_TAG
               PROJECT=$PROJECT
               GERRIT_REFSPEC=$GERRIT_REFSPEC
             block: true
       - trigger-builds:
-         -  project: "{jobs_to_trigger}"
-            condition: UNSTABLE_OR_BETTER
+         -  project: "{project-name}-{stream}-project-csit-PoC"
             predefined-parameters: |
               UNIQUE_DOCKER_TAG=$BUILD_TAG
               PROJECT=$PROJECT
     publishers:
       - lf-infra-publish
 
+- job-template:
+    name: '{project-name}-unified-merge-{stream}-PoC'
+    disabled: '{disabled}'
+    project-type: freestyle
+    build-node: 'ubuntu1804-docker-8c-8g'
+    java-version: 'openjdk11'
+
+    properties:
+      - lf-infra-properties:
+          project: '{project}'
+          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:
+      - lf-infra-wrappers:
+          build-timeout: '{build-timeout}'
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+    builders:
+      - lf-infra-pre-build
+      - lf-maven-install:
+          mvn-version: "{mvn-version}"
+      - lf-update-java-alternatives:
+          java-version: "{java-version}"
+      - lf-provide-maven-settings:
+          global-settings-file: "{mvn-global-settings}"
+          settings-file: "{mvn-settings}"
+      - trigger-builds:
+         -  project: "{project-name}-{stream}-{artifact-type}-docker-snapshot-PoC"
+            predefined-parameters: |
+              UNIQUE_DOCKER_TAG=$BUILD_TAG
+              PROJECT=$PROJECT
+              BRANCH=$BRANCH
+              GERRIT_REFSPEC=$GERRIT_REFSPEC
+            block: true
+      - trigger-builds:
+         -  project: "{project-name}-{stream}-project-csit-PoC"
+            predefined-parameters: |
+              UNIQUE_DOCKER_TAG=$BUILD_TAG
+              PROJECT=$PROJECT
+              BRANCH=$BRANCH
+              GERRIT_REFSPEC=$GERRIT_REFSPEC
+            block: true
+      - trigger-builds:
+         -  project: "{project-name}-{stream}-docker-staging-PoC"
+            predefined-parameters: |
+              UNIQUE_DOCKER_TAG=$BUILD_TAG
+              PROJECT=$PROJECT
+              BRANCH=$BRANCH
+              GERRIT_REFSPEC=$GERRIT_REFSPEC
+            block: true
+    triggers:
+      - gerrit-trigger-patch-merged:
+          server: '{server-name}'
+          project: '{project}'
+          branch: '{branch}'
+          files: '**'
+    publishers:
+      - lf-infra-publish
+
index 71d5879..52e3670 100644 (file)
@@ -2,18 +2,16 @@
 - project:
     name: music-distributed-kv-store-csit
     jobs:
-      - '{project-name}-{stream}-project-csit-{functionality}-PoC'
+      - '{project-name}-{stream}-project-csit-PoC'
       - '{project-name}-unified-review-{stream}-PoC'
+      - '{project-name}-unified-merge-{stream}-PoC'
     project-name: 'music-distributed-kv-store'
     project: 'music/distributed-kv-store'
     stream: 'master'
+    artifact-type: 'golang'
     java-version: openjdk11
     mvn-version: 'mvn36'
     mvn-settings: 'music-distributed-kv-store-settings'
     mvn-global-settings: global-settings
-    functionality:
-      - 'music-distributed-kv-store-test-plan'
-    jobs_to_trigger:
-      - 'music-distributed-kv-store-master-project-csit-music-distributed-kv-store-test-plan-PoC'
     robot-options: ''
     branch: 'master'
index 4ad0a39..d01f599 100644 (file)
@@ -6,13 +6,20 @@
     jobs:
       - '{project-name}-{stream}-verify-golang'
       - '{project-name}-{stream}-merge-golang'
-      - '{project-name}-{stream}-docker-golang-snapshot-PoC':
+      - '{project-name}-{stream}-docker-golang-shell-daily':
           script:
             !include-raw-escape: 'build-music-distributed-kv-store-image.sh'
+      - '{project-name}-{stream}-golang-docker-snapshot-PoC':
+          script:
+            !include-raw-escape: 'build-music-distributed-kv-store-image.sh'
+      - '{project-name}-{stream}-docker-staging-PoC':
+          script:
+            !include-raw-escape: 'tag-music-distributed-kv-store-image-staging.sh'
     project: 'music/distributed-kv-store'
     stream:
       - 'master':
           branch: 'master'
+    artifact-type: 'golang'
     mvn-settings: 'music-distributed-kv-store-settings'
     files: '**'
     archive-artifacts: ''
diff --git a/jjb/music/tag-music-distributed-kv-store-image-staging.sh b/jjb/music/tag-music-distributed-kv-store-image-staging.sh
new file mode 100755 (executable)
index 0000000..0c28eec
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+echo '=========== CALLING SCRIPT TO TAG DOCKER IMAGES AS STAGING ==========='
+echo "=========== Unique docker tag: ${UNIQUE_DOCKER_TAG}"
+CURRENTDIR="$(pwd)"
+echo $CURRENTDIR
+
+chmod 755 ./deployment/*.sh
+cd ./deployment
+./tag-docker-staging.sh