Merge "Add git-review to base system"
[releng/builder.git] / jjb / releng-macros.yaml
index f13bef94192cdf1c42a9f7fb90e569329ef9d36d..533977946582cda8ecb758e5585c222ee53d320c 100644 (file)
@@ -1,5 +1,11 @@
 # OLD Releng macros
 
+- property:
+    name: opendaylight-infra-properties
+    properties:
+        - build-discarder:
+            days-to-keep: '{build-days-to-keep}'
+
 - parameter:
     name: opendaylight-infra-parameters
     parameters:
             name: GERRIT_REFSPEC
             default: '{refspec}'
             description: "GERRIT_REFSPEC parameter if not given by trigger"
+        - string:
+            name: STACK_NAME
+            default: '$JOB_NAME-$BUILD_NUMBER'
+            description: "Used by Heat to generate a unique stack & vm name"
 
 - parameter:
     name: build-tag
     publishers:
         - postbuildscript:
             builders:
+                - shell: |
+                    if [ -d "$WORKSPACE/.venv-openstack" ]; then
+                        source $WORKSPACE/.venv-openstack/bin/activate
+                        openstack --os-cloud rackspace stack delete --yes $STACK_NAME
+                    fi
                 - shell: !include-raw: include-raw-deploy-archives.sh
                 - maven-target:
                         maven-version: '{maven-version}'
               - '**/*.jenkins-trigger'
             fail-build: false
 
+- builder:
+    name: opendaylight-infra-stack
+    # opendaylight-infra-stack.sh has a required variable {stack-template} that
+    # must be passed into this macro.
+    builders:
+        - shell: !include-raw: opendaylight-infra-stack.sh
+        - shell: !include-raw-escape: opendaylight-infra-copy-ssh-keys.sh
+
 - builder:
     name: wipe-org-opendaylight-repo
     builders:
     # needed by OpenDaylight infra.
     name: opendaylight-infra-wrappers
     wrappers:
+        - mask-passwords
+        - config-file-provider:
+            files:
+                - file-id: rackspace-heat
+                  target: '$HOME/.config/openstack/clouds.yaml'
         - timeout:
             type: absolute
             timeout: '{build-timeout}'
         - ssh-agent-credentials:
             users:
                 - 'opendaylight-jenkins-ssh'
-        - jclouds:
-            single-use: True
         - openstack:
             single-use: True
 
                         packer.io build -var-file=$CLOUDENV \
                          -var-file=../packer/vars/{platform}.json \
                          ../packer/templates/{template}.json
+
+- builder:
+    # TODO: Verify signature after downloading users public key from a locally created
+    # repository instead of the public keymesh. This requires a process in place to get ODL
+    # developers public keys into a local repository without increasing the job thoughput.
+    name: verify-gpg-signature
+    builders:
+        - shell: !include-raw: include-raw-verify-gpg-signatures.sh