Merge "Switch to using global-jjb mvn macros"
[releng/builder.git] / jjb / autorelease / autorelease-macros.yaml
index 4d012d69b42a60c7643c291adfe90016941a0c1c..eab728fb963216663446a94bc1303b555c80a972 100644 (file)
@@ -8,14 +8,6 @@
           default: '{release-tag}'
           description: "The Release train tag to use eg. Beryllium-SR1"
 
-- parameter:
-    name: autorelease-release-branch
-    parameters:
-      - string:
-          name: RELEASE_BRANCH
-          default: '{release-branch}'
-          description: "The Release train branch to base build off eg. stable/beryllium"
-
 - wrapper:
     name: autorelease-build-timeout
     wrappers:
     name: autorelease-checkout-gerrit-patch
     builders:
       - shell: |
-          cd ${GERRIT_PROJECT}
+          #!/bin/bash
+          set -eu -o pipefail
+
+          # If the project is autorelease then we do not need to cd
+          if [ "$GERRIT_PROJECT" != "releng/autorelease" ]; then
+              cd "$WORKSPACE/$GERRIT_PROJECT"
+          fi
+
           echo "Checking out ${GERRIT_PROJECT} patch ${GERRIT_REFSPEC}..."
           git fetch origin ${GERRIT_REFSPEC} && git checkout FETCH_HEAD
-          cd ..
+
+          # If the project is autorelease then we need to init and update submodules
+          if [ "$GERRIT_PROJECT" == "releng/autorelease" ]; then
+              git submodule update --init
+          fi
 
 - builder:
     name: autorelease-cfp
@@ -40,7 +43,7 @@
           files:
             - file-id: 'autorelease-settings'
               variable: 'SETTINGS_FILE'
-            - file-id: 'odl-global-settings'
+            - file-id: 'global-settings'
               variable: 'GLOBAL_SETTINGS_FILE'
 
 - builder:
     builders:
       - integration-set-variables
       - shell: |
+          #!/bin/bash
+          set +e  # DO NOT fail build if copying fails.
+
           if [ -d "integration/distribution/distributions" ]; then
               cp -vf "$WORKSPACE/taglist.log" "integration/distribution/distributions/karaf/src/main/assembly/"
           else
               cp -vf "$WORKSPACE/taglist.log" "integration/distribution/$KARAF_ARTIFACT/src/main/assembly/"
           fi
 
+          # DO NOT fail the build if copying failed.
+          exit 0
+
 - builder:
     name: autorelease-generate-release-patches
     builders:
       - shell: !include-raw:
           - ../global-jjb/shell/lftools-install.sh
-          - include-raw-autorelease-release-versions.sh
+          - prepare-release.sh
 
 - builder:
     name: autorelease-get-integration-test-variables
           fi
 
 - publisher:
-    # include-raw-autorelease-notify-build-failure.sh searches console log for
-    # failures and emails the status to the release mailing list.
+    # Search console log for failures and email status to the release mailing list.
     name: opendaylight-infra-notify-status
     publishers:
       - postbuildscript:
           builders:
-            - shell: !include-raw: include-raw-autorelease-notify-build-failure.sh
-          script-only-if-succeeded: 'False'
-          script-only-if-failed: 'True'
-
-- publisher:
-    # generate sar accounting summary and copy sar data to archive
-    name: opendaylight-infra-sysstats
-    publishers:
-      - postbuildscript:
-          builders:
-            - shell: !include-raw: include-raw-autorelease-collect-sar.sh
+            - shell: !include-raw: notify-build-failure.sh
           script-only-if-succeeded: false
-          script-only-if-failed: false
+          script-only-if-failed: true