Simplify val-autorelease and distro-check state definition
[releng/builder.git] / jjb / integration / integration-macros.yaml
index 533eb9774cae00f75f0c8b4042f3dd59a14bbbce..83daad88bdfbfe1b864d2540a43452f326453463 100644 (file)
               template-name: '{openstack-image}'
               count: '{openstack-vms}'
 
+# Macro: integration-jclouds-controller-docker
+# Operation: this macro will sping the controller and docker vms
+# Used by: {project}-csit-docker job templates
+- wrapper:
+    name: integration-jclouds-controller-docker
+    wrappers:
+      - jclouds:
+          instances:
+            - '{controller-image}':
+                cloud-name: 'ODLPUB'
+                count: '{controller-vms}'
+            - '{docker-image}':
+                cloud-name: 'ODLPUB'
+                count: '{docker-vms}'
+
 #################
 # Shell Scripts #
 #################
         - shell: |
             #!/bin/bash
             function copy-ssh-keys-to-slave() {
-                RETRIES=30
+                RETRIES=60
                 for j in $(seq 1 $RETRIES); do
                     if `ssh-copy-id -i /home/jenkins/.ssh/id_rsa.pub "jenkins@${i}" > /dev/null 2>&1`; then
                         ssh jenkins@${i} 'echo "$(facter ipaddress_eth0) $(/bin/hostname)" | sudo tee -a /etc/hosts'
             echo "OpenStack IPS are ${JCLOUDS_IPS}"
 
             IFS=',' read -ra ADDR <<< "${JCLOUDS_IPS}"
-
+            pids=""
             for i in "${ADDR[@]}"; do
-                copy-ssh-keys-to-slave &
+                ( copy-ssh-keys-to-slave ) &
+                # Store PID of process
+                pids+=" $!"
             done
 
-            wait
+            # Detect when a process failed to copy ssh keys and fail build
+            for p in $pids; do
+                if wait $p; then
+                    echo "Process $p successfully copied ssh keys."
+                else
+                    echo "Process $p failed to copy ssh keys."
+                    exit 1
+                fi
+            done
             echo "Copying ssh keys complete."
 
 # Macro: integration-get-slave-addresses
                     mkdir $WORKSPACE/archives
                     curl --output robot-plugin.zip "$BUILD_URL/robot/report/*zip*/robot-plugin.zip"
                     unzip -d $WORKSPACE/archives robot-plugin.zip
-                    mv *log* *.log *.csv *.png $WORKSPACE/archives || true  # Don't fail if file missing
+                    mv *log* *.log *.log.gz *.csv *.png $WORKSPACE/archives || true  # Don't fail if file missing
             script-only-if-succeeded: False
             script-only-if-failed: False
             mark-unstable-if-failed: True