Add mri-stage job 63/97263/3
authorTomas Cere <tomas.cere@pantheon.tech>
Thu, 19 Aug 2021 11:11:07 +0000 (13:11 +0200)
committerTomas Cere <tomas.cere@pantheon.tech>
Thu, 19 Aug 2021 14:38:58 +0000 (16:38 +0200)
This job stages a project and then triggers an mri
distribution test job which runs csit on the staged
artifacts from the staging repo.

Add netconf stage/distribution job definitions
Repoint netconf streams to master

Change-Id: I473ef076e22df17bb5e0c0f7a9e7adcac0bd2822
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
13 files changed:
jjb/defaults.yaml
jjb/integration/integration-test-jobs.yaml
jjb/netconf/netconf-clustering-scale.yaml
jjb/netconf/netconf-clustering.yaml
jjb/netconf/netconf-csit-callhome.yaml
jjb/netconf/netconf-distribution-mri-test.yaml [new file with mode: 0644]
jjb/netconf/netconf-patch-test.yaml
jjb/netconf/netconf-scale.yaml
jjb/netconf/netconf-userfeatures.yaml
jjb/netconf/netconf.yaml
jjb/releng-maven-mri-stage.sh [new file with mode: 0644]
jjb/releng-maven-mri-stage.yaml [new file with mode: 0644]
jjb/releng-templates-java.yaml

index 63b6f381e7e3efb3d672cf32ae54b37632c6a3e5..b227f087c1f69d166bced9a6ba83d91b5d1a172d 100644 (file)
       controller-csit-3node-rest-clust-cars-perf-ask-only-phosphorus,
       controller-csit-3node-rest-clust-cars-perf-tell-only-phosphorus,
       mdsal-csit-3node-netty-replicate-only-phosphorus,
-      netconf-csit-1node-callhome-only-phosphorus,
-      netconf-csit-1node-scale-max-devices-only-phosphorus,
-      netconf-csit-1node-scale-only-phosphorus,
-      netconf-csit-1node-userfeatures-all-phosphorus,
-      netconf-csit-1node-userfeatures-rfc8040-all-phosphorus,
-      netconf-csit-3node-clustering-only-phosphorus,
-      netconf-csit-3node-clustering-scale-only-phosphorus,
+      netconf-csit-1node-callhome-only-master,
+      netconf-csit-1node-scale-max-devices-only-master,
+      netconf-csit-1node-scale-only-master,
+      netconf-csit-1node-userfeatures-all-master,
+      netconf-csit-1node-userfeatures-rfc8040-all-master,
+      netconf-csit-3node-clustering-only-master,
+      netconf-csit-3node-clustering-scale-only-master,
       yangtools-csit-1node-system-only-phosphorus
     csit-weekly-list-phosphorus: >
       controller-csit-1node-notifications-longevity-only-phosphorus,
index 1ea80ad64ec60e31d74d80599423407d0fc571d6..0baa6db296b3f2f4311378433ec67f71c72c9c6e 100644 (file)
           email-recipients: "{email-recipients}"
           email-prefix: "[integration]"
 
+- job-template:
+    name: "{project}-distribution-mri-test-{stream}"
+    id: inttest-distribution-mri-test
+
+    project-type: freestyle
+    node: queue-intque-2c-1g
+
+    properties:
+      - opendaylight-infra-properties:
+          build-days-to-keep: "{build-days-to-keep}"
+
+    parameters:
+      - integration-bundle-url:
+          bundle-url: "{bundle-url}"
+      - distribution-karaf-version:
+          karaf-version: "{karaf-version}"
+
+    triggers:
+      - timed: "{schedule-weekly}"
+
+    builders:
+      - trigger-builds:
+          - project: "{csit-mri-list}"
+            block: true
+            predefined-parameters: |
+              BUNDLE_URL=$BUNDLE_URL
+              KARAF_VERSION=$KARAF_VERSION
+
+    publishers:
+      - email-notification:
+          email-recipients: "{email-recipients}"
+          email-prefix: "[integration]"
+
 - job-template:
     name: "integration-distribution-weekly-test-trigger-{stream}"
 
index 1fb4d5fafba96f28739e7517eaf69791076c1a3c..49e5a8164240c4391b741c3ef1aa59f5e12cd3a2 100644 (file)
@@ -12,7 +12,7 @@
 
     # Project branches
     stream:
-      - phosphorus:
+      - master:
           branch: "master"
           jre: "openjdk11"
       - silicon:
index 3e98cc930d0a0a5fad28551415ad653573953889..cdc0e1a057cf45fa88243408423e565e5ce75355 100644 (file)
@@ -12,7 +12,7 @@
 
     # Project branches
     stream:
-      - phosphorus:
+      - master:
           branch: "master"
           jre: "openjdk11"
       - silicon:
index 06d26ba611185a1106082f2bcd972e7cd9588be9..7f3dd75afb5629366947a273bbc572677c1b1091 100644 (file)
@@ -14,7 +14,7 @@
 
     # Project branches
     stream:
-      - phosphorus:
+      - master:
           branch: "master"
           jre: "openjdk11"
       - silicon:
diff --git a/jjb/netconf/netconf-distribution-mri-test.yaml b/jjb/netconf/netconf-distribution-mri-test.yaml
new file mode 100644 (file)
index 0000000..de768e6
--- /dev/null
@@ -0,0 +1,30 @@
+---
+- project:
+    name: netconf-distribution-mri-test
+    jobs:
+      - inttest-distribution-mri-test
+
+    project: "netconf"
+
+    stream:
+      - master:
+          branch: "master"
+          java-version: "openjdk11"
+      - silicon:
+          branch: "stable/silicon"
+          java-version: "openjdk11"
+      - aluminium:
+          branch: "stable/aluminium"
+          java-version: "openjdk11"
+
+    os-branch: "queens"
+
+    karaf-version: netconf
+
+    csit-mri-list: >
+      netconf-csit-1node-gate-callhome-only-{stream},
+      netconf-csit-1node-gate-userfeatures-all-{stream},
+      netconf-csit-1node-gate-userfeatures-rfc8040-all-{stream},
+      netconf-csit-1node-scale-only-{stream},
+      netconf-csit-3node-clustering-only-{stream},
+      netconf-csit-3node-clustering-scale-only-{stream}
index 4b6984a168a41e7ecb8766cf8da1bc4347234834..5dbe246fa194724e6fcd63053bf567d439f02f85 100644 (file)
@@ -7,7 +7,7 @@
     project: "netconf"
 
     stream:
-      - phosphorus:
+      - master:
           branch: "master"
           java-version: "openjdk11"
       - silicon:
index 3f5581c94c4fd28ea18731920311d1d4c9d261ae..a08f3c28870fe91b608d07d72bc894a1b6ef9c57 100644 (file)
@@ -12,7 +12,7 @@
 
     # Project branches
     stream:
-      - phosphorus:
+      - master:
           branch: "master"
           jre: "openjdk11"
       - silicon:
index 66eab97dd35a77b49f68403e2812bbde0b50dd6f..1bf4193a7c4fe964859ffc8ff0217499c381e65f 100644 (file)
@@ -18,7 +18,7 @@
 
     # Project branches
     stream:
-      - phosphorus:
+      - master:
           branch: "master"
           jre: "openjdk11"
       - silicon:
index ab8f59214517f3ffac7453caaa2b4393d677cffb..e4f7cab67065116e5854fa7e7753d2e5f89fab98 100644 (file)
@@ -15,6 +15,7 @@
     project-name: "netconf"
     branch: "master"
     java-version: "openjdk11"
+    karaf-version: "netconf"
     mvn-settings: "netconf-settings"
     mvn-goals: "clean deploy -Pintegrationtests"
     mvn-opts: "-Xmx2048m -Dmaven.compile.fork=true"
@@ -41,6 +42,7 @@
     project-name: "netconf"
     branch: "1.13.x"
     java-version: "openjdk11"
+    karaf-version: "netconf"
     mvn-settings: "netconf-settings"
     mvn-goals: "clean deploy -Pintegrationtests"
     mvn-opts: "-Xmx2048m -Dmaven.compile.fork=true"
@@ -68,6 +70,7 @@
     project-name: "netconf"
     branch: "stable/aluminium"
     java-version: "openjdk11"
+    karaf-version: "netconf"
     mvn-settings: "netconf-settings"
     mvn-goals: "clean deploy -Pintegrationtests"
     mvn-opts: "-Xmx2048m -Dmaven.compile.fork=true"
@@ -88,6 +91,7 @@
     project: "netconf"
     project-name: "netconf"
     branch: "1.7.4.x"
+    karaf-version: "netconf"
     mvn-settings: "netconf-settings"
     mvn-goals: "clean deploy -Pintegrationtests"
     mvn-opts: "-Xmx2048m -Dmaven.compile.fork=true"
diff --git a/jjb/releng-maven-mri-stage.sh b/jjb/releng-maven-mri-stage.sh
new file mode 100644 (file)
index 0000000..d3920bb
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+echo "---> releng-maven-mri-stage.sh"
+# This script publishes artifacts to a staging repo in Nexus and exports the karaf bundle URL.
+#
+# $WORKSPACE/m2repo   :  Exists and used to deploy the staging repository.
+# $NEXUS_URL          :  Jenkins global variable should be defined.
+# $STAGING_PROFILE_ID :  Provided by a job parameter.
+
+# Ensure we fail the job if any steps fail.
+set -xeu -o pipefail
+
+TMP_FILE="$(mktemp)"
+lftools deploy nexus-stage "$NEXUS_URL" "$STAGING_PROFILE_ID" "$WORKSPACE/m2repo" | tee "$TMP_FILE"
+staging_repo=$(sed -n -e 's/Staging repository \(.*\) created\./\1/p' "$TMP_FILE")
+
+# Store repo info to a file in archives
+mkdir -p "$WORKSPACE/archives"
+echo "$staging_repo ${NEXUS_URL}/content/repositories/$staging_repo" | tee -a "$WORKSPACE/archives/staging-repo.txt"
+
+staged_version=$(find . -name '*karaf*.pom' -exec xpath -q -e '/project/version/text()' {} +)
+BUNDLE_URL="${NEXUS_URL}/content/repositories/$staging_repo/org/opendaylight/${PROJECT}/${KARAF_ARTIFACT}/${staged_version}/${KARAF_ARTIFACT}-${staged_version}.zip"
+
+# Cleanup
+rm -f "$TMP_FILE"
+
+echo "Bundle url is ${BUNDLE_URL}"
+
+# Re-inject the new BUNDLE_URL for downstream jobs to pull from Nexus
+cat > "${WORKSPACE}/maven-staged-bundle.env" <<EOF
+BUNDLE_URL=${BUNDLE_URL}
+KARAF_VERSION=${KARAF_VERSION}
+EOF
diff --git a/jjb/releng-maven-mri-stage.yaml b/jjb/releng-maven-mri-stage.yaml
new file mode 100644 (file)
index 0000000..cd957c0
--- /dev/null
@@ -0,0 +1,206 @@
+####################
+# COMMON FUNCTIONS #
+####################
+
+- releng_maven_mri_common: &releng_maven_mri_common
+    name: releng-maven-mri-common
+
+    ######################
+    # Default parameters #
+    ######################
+
+    archive-artifacts: >
+      **/*.log
+      **/hs_err_*.log
+      **/target/**/feature.xml
+      **/target/failsafe-reports/failsafe-summary.xml
+      **/target/surefire-reports/*-output.txt
+
+    #####################
+    # Job Configuration #
+    #####################
+
+    project-type: freestyle
+    node: "{build-node}"
+
+    properties:
+      - lf-infra-properties:
+          build-days-to-keep: "{build-days-to-keep}"
+
+    parameters:
+      - lf-infra-parameters:
+          project: "{project}"
+          branch: "{branch}"
+          stream: "{stream}"
+      - lf-infra-maven-parameters:
+          mvn-opts: "{mvn-opts}"
+          mvn-params: "{mvn-params}"
+          mvn-version: "{mvn-version}"
+      - string:
+          name: ARCHIVE_ARTIFACTS
+          default: "{archive-artifacts}"
+          description: Artifacts to archive to the logs server.
+
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: "{build-timeout}"
+          jenkins-ssh-credential: "{jenkins-ssh-credential}"
+
+    publishers:
+      # TODO: Make email notification work.
+      # - lf-infra-email-notify:
+      #     email-recipients: '{email-recipients}'
+      #     email-prefix: '[releng]'
+      - lf-infra-publish
+
+- builder:
+    name: maven-mri-stage
+    builders:
+      - lf-provide-maven-settings:
+          global-settings-file: "{mvn-global-settings}"
+          settings-file: "{mvn-settings}"
+      - lf-infra-create-netrc:
+          server-id: "{mvn-staging-id}"
+      # include-raw-escape fails due to JJB bug
+      - shell: !include-raw-escape:
+          - global-jjb/shell/common-variables.sh
+          - releng-maven-mri-stage.sh
+      - lf-provide-maven-settings-cleanup
+
+###############
+# Maven Stage #
+###############
+
+- releng_maven_mri_stage: &releng_maven_mri_stage
+    name: releng-maven-mri-stage
+
+    ######################
+    # Default parameters #
+    ######################
+
+    branch: master
+    build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
+    build-timeout: 60
+    cron: "@daily"
+    disable-job: false
+    git-url: "$GIT_URL/$PROJECT"
+    github-url: "https://github.com"
+    java-version: openjdk8
+    maven-versions-plugin: false
+    version-properties-file: version.properties
+    mvn-central: false
+    mvn-global-settings: global-settings
+    mvn-goals: clean deploy
+    mvn-opts: ""
+    mvn-params: ""
+    mvn-version: mvn35
+    ossrh-profile-id: ""
+    mvn-pom: ""
+    sign-artifacts: false
+    sign-mode: serial
+    stream: master
+    submodule-recursive: true
+    submodule-timeout: 10
+    submodule-disable: false
+
+    gerrit_release_triggers:
+      - comment-added-contains-event:
+          comment-contains-value: '^Patch Set\s+\d+:\s+stage-(maven-)?release\s*$'
+
+    gerrit_trigger_file_paths:
+      - compare-type: ANT
+        pattern: "**"
+
+    # github_included_regions MUST match gerrit_trigger_file_paths
+    github_included_regions:
+      - ".*"
+
+    #####################
+    # Job Configuration #
+    #####################
+
+    disabled: "{disable-job}"
+
+    parameters:
+      - lf-infra-parameters:
+          project: "{project}"
+          branch: "{branch}"
+          stream: "{stream}"
+      - lf-infra-maven-parameters:
+          mvn-opts: "{mvn-opts}"
+          mvn-params: "{mvn-params}"
+          mvn-version: "{mvn-version}"
+          staging-profile-id: "{staging-profile-id}"
+      - bool:
+          name: MAVEN_VERSIONS_PLUGIN
+          default: "{maven-versions-plugin}"
+          description: Use maven-versions-plugin to update pom versions.
+      - string:
+          name: ARCHIVE_ARTIFACTS
+          default: "{archive-artifacts}"
+          description: Artifacts to archive to the logs server.
+      - string:
+          name: STAGING_PROFILE_ID
+          default: "{staging-profile-id}"
+          description: Nexus staging profile ID.
+
+    builders:
+      - lf-infra-pre-build
+      - lf-jacoco-nojava-workaround
+      - integration-set-variables
+      - 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}"
+      - lf-maven-versions-plugin:
+          maven-versions-plugin: "{maven-versions-plugin}"
+          version-properties-file: "{version-properties-file}"
+          mvn-version: "{mvn-version}"
+          mvn-pom: "{mvn-pom}"
+          mvn-settings: "{mvn-settings}"
+      - shell: !include-raw-escape: global-jjb/shell/maven-patch-release.sh
+      - lf-maven-build:
+          mvn-goals: "{mvn-goals}"
+      - lf-sigul-sign-dir:
+          sign-artifacts: "{sign-artifacts}"
+          sign-dir: "$WORKSPACE/m2repo"
+          sign-mode: "{sign-mode}"
+      - maven-mri-stage:
+          mvn-global-settings: "{mvn-global-settings}"
+          mvn-settings: "{mvn-settings}"
+          mvn-staging-id: "{mvn-staging-id}"
+      - lf-maven-central:
+          mvn-central: "{mvn-central}"
+          mvn-global-settings: "{mvn-global-settings}"
+          mvn-settings: "{mvn-settings}"
+          ossrh-profile-id: "{ossrh-profile-id}"
+      - lf-provide-maven-settings-cleanup
+      - inject:
+          properties-file: maven-staged-bundle.env
+      - trigger-builds:
+          - project: "{project-name}-distribution-mri-test-{stream}"
+            block: true
+            predefined-parameters: |
+              BUNDLE_URL=$BUNDLE_URL
+              KARAF_VERSION=$KARAF_VERSION
+
+- job-template:
+    name: "{project-name}-maven-mri-stage-{stream}"
+    id: gerrit-maven-mri-stage
+    <<: *releng_maven_mri_common
+    # yamllint disable-line rule:key-duplicates
+    <<: *releng_maven_mri_stage
+
+    scm:
+      - lf-infra-gerrit-scm:
+          jenkins-ssh-credential: "{jenkins-ssh-credential}"
+          git-url: "{git-url}"
+          refspec: "$GERRIT_REFSPEC"
+          branch: "$GERRIT_BRANCH"
+          submodule-recursive: "{submodule-recursive}"
+          submodule-timeout: "{submodule-timeout}"
+          submodule-disable: "{submodule-disable}"
+          choosing-strategy: default
index ac491283a2878dd5448bb408636276f5100fcf60..832db0cc39a7ba0bca9e3c64e5bcb649532576c5 100644 (file)
           sign-artifacts: true
           cron: ""
 
+      - gerrit-maven-mri-stage:
+          sign-artifacts: true
+          cron: ""
+
     java-version: openjdk11
     mvn-version: mvn35
 
           ossrh-profile-id: 6386ebbbf3a563
           cron: ""
 
+      - gerrit-maven-mri-stage:
+          sign-artifacts: true
+          mvn-central: false
+          ossrh-profile-id: 6386ebbbf3a563
+          cron: ""
+
     java-version: openjdk8
     mvn-version: mvn35
     disable-job: "{disable-job}"