Check if distribution came from jenkins
[releng/builder.git] / jjb / integration / integration-macros.yaml
index 2cf8eee2efa654ffaac1a014da005c4e1457ce77..1e9005cd4577218010f5cf60dbd8d771c08ac5ef 100644 (file)
           description: 'Distribution GIT branch'
 
 - parameter:
-    name: integration-bundleurl
+    name: distribution-karaf-version
+    # Arguments:
+    #   karaf-version: Provide, otherwise releng-defaults value is used.
     parameters:
       - string:
-          name: BUNDLEURL
-          default: '{bundleurl}'
+          name: KARAF_VERSION
+          default: '{karaf-version}'
+          description: 'karaf3 or karaf4, affects ODL deploy scripts'
+
+- parameter:
+    name: integration-bundle-url
+    parameters:
+      - string:
+          name: BUNDLE_URL
+          default: '{bundle-url}'
           description: 'URL to karaf distribution zip'
 
 - parameter:
     builders:
       - shell: !include-raw: include-raw-integration-get-slave-addresses.sh
 
-# Macro: integration-get-bundle-vars
-# Operation: this macro gets all bundle related variables
-# Used by: {project}-csit-3node-* job templates
-
 - builder:
-    name: integration-get-bundle-vars
+    name: integration-set-variables
+    # Operation: Construct variables not requiring online detection and export using set_variables.env
+    # Required bash variables:
+    #   KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
     builders:
-      - shell: !include-raw: include-raw-integration-get-bundle-vars.sh
+      - shell: !include-raw: integration-set-variables.sh
+      - inject:
+          properties-file: set_variables.env
 
-# Macro: integration-distribution-check
-# Operation: this macro deploys the controller with all fetures
-# Used by: {project}-distribution-check-{stream} job template
+- builder:
+    name: integration-detect-variables
+    # Operation: Construct variables including online detection and export using detect_variables.env
+    #   This calls integration-set-variables internally.
+    # Required bash variables:
+    #   KARAF_VERSION: 'karaf4' or 'karaf3'. Use distribution-karaf-version macro to set.
+    builders:
+      - integration-set-variables
+      - shell: !include-raw: integration-detect-variables.sh
+      - inject:
+          properties-file: detect_variables.env
 
 - builder:
     name: integration-distribution-check
+    # Operation: Locally deploy ODL with all fetures, check it is not broken.
+    # Required bash variables:
+    #   KARAF_VERSION: 'karaf4' or 'karaf3'.
+    #     Use distribution-karaf-version macro to customize.
     builders:
-      - shell: !include-raw: include-raw-integration-distribution-check.sh
-
-# Macro: integration-deploy-controller-verify
-# Operation: this macro deploys the controller with all fetures
-# Used by: distribution-deploy-{stream} job template
+      - integration-set-variables
+      - shell: !include-raw: integration-distribution-check.sh
 
 - builder:
-    name: integration-deploy-controller-verify
+    name: distribution-deploy-verify
+    # Operation: Deploy ODL with all fetures and check it is not broken.
+    # Required bash variables:
+    #   KARAF_VERSION: 'karaf4' or 'karaf3'.
+    #     Use distribution-karaf-version macro to customize.
     builders:
-      - shell: !include-raw: include-raw-integration-deploy-controller-verify.sh
-
-# Macro: integration-deploy-controller-offline
-# Operation: this macro deploys the controller with no external repo configuration
-# Used by: integration-distrbution-offline-{stream} job template
+      - integration-detect-variables
+      - shell: !include-raw: distribution-deploy-verify.sh
 
 - builder:
-    name: integration-deploy-controller-offline
+    name: distribution-deploy-offline
+    # Operation: Deploys ODL on the current system, with no external repo configuration, check it works.
+    # Required bash variables:
+    #   KARAF_VERSION: 'karaf4' or 'karaf3'.
+    #     Use distribution-karaf-version macro to customize.
     builders:
-      - shell: !include-raw: include-raw-integration-deploy-controller-offline.sh
+      - integration-detect-variables
+      - shell: !include-raw: distribution-deploy-offline.sh
 
 # Macro: integration-deply-controller-run-test
 # Operation: this macro deploys single contoller and runs test
     builders:
       - shell: !include-raw: include-raw-integration-start-cluster-run-test.sh
 
-# Macro: integration-get-bundle-url
-# Operation: this macro gets the job generated distribution URL from distribution pom.xml
-# Used by: integration-patch-test-{stream} job template
-
-- builder:
-    name: integration-get-bundle-url
-    builders:
-      - shell: !include-raw: include-raw-integration-get-bundle-url.sh
-
-# Macro: integration-get-bundle-url-root
-# Operation: this macro gets the job generated distribution URL from root pom.xml
-# Used by: distribution-verify-{stream} job template
-
-- builder:
-    name: integration-get-bundle-url-root
-    builders:
-      - shell: !include-raw: include-raw-integration-get-bundle-url-root.sh
-
 # Macro: integration-install-robotframework
 # Operation: Installs robotframework using pip to a virtualenv
 # Used by: {project}-csit-* job templates
     builders:
       - shell: !include-raw: include-raw-integration-replace-block-text.sh
 
-# Macro: integration-compare-distributions
-# Operation: will compare an already created distribtion (probably last
-# published to nexus) to the current distribution being created.
-# The comparison is done to find the list of patches that are new to the
-# current distribtion.
-# Used by: builder-merge job template
-#
-# This script requires the bundle vars that are created by the
-# get-bundle-vars macro script
-
 
 - builder:
     name: integration-compare-distributions
+    # Operation: will compare an already created distribtion (probably last
+    # published to nexus) to the current distribution being created.
+    # The comparison is done to find the list of patches that are new to the
+    # current distribution.
+    # Required bash variables:
+    #   KARAF_ARTIFACT: 'karaf' or 'distribution-karaf'. Use integration-set-variables.
     builders:
       - shell: !include-raw: include-raw-integration-compare-distributions.sh
 
+- builder:
+    name: integration-upload-distribution
+    # Upload distribution karaf artifact to Nexus SNAPSHOT repo for testing.
+    # Arguments:
+    #   {dist-pom} path to pom file containing the version
+    # Required bash variables:
+    #   KARAF_VERSION: 'karaf4' or 'karaf3'.
+    #     Use distribution-karaf-version macro to customize.
+    builders:
+      - config-file-provider:
+          files:
+            - file-id: odl-global-settings
+              variable: GLOBAL_SETTINGS_FILE
+            - file-id: integration-settings
+              variable: SETTINGS_FILE
+      - integration-set-variables
+      - inject:
+          properties-content: BUNDLE_POM={dist-pom}
+      - shell: !include-raw-escape: integration-upload-distribution.sh
+      - inject:
+          properties-file: integration-upload-distribution.env
+
 ##############
 # Publishers #
 ##############