X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fintegration%2Fintegration-macros.yaml;h=198f7b30f855f8c2d81aa524c038144f8953b916;hb=73e1640af71a91132e91c9e854f470918be504c0;hp=d43905b74e962704c9f7f7e91ceb640f55decef6;hpb=755df2529e71a80299c0036b61eb5464d40133a3;p=releng%2Fbuilder.git diff --git a/jjb/integration/integration-macros.yaml b/jjb/integration/integration-macros.yaml index d43905b74..198f7b30f 100644 --- a/jjb/integration/integration-macros.yaml +++ b/jjb/integration/integration-macros.yaml @@ -94,7 +94,7 @@ name: integration-gerrit-scm scm: - git: - credentials-id: '{credentials-id}' + credentials-id: 'opendaylight-jenkins-ssh' url: '$GIT_BASE' basedir: '{basedir}' refspec: '{refspec}' @@ -111,7 +111,7 @@ name: integration-distribution-scm scm: - git: - credentials-id: '{credentials-id}' + credentials-id: 'opendaylight-jenkins-ssh' basedir: 'distribution' url: '$DISTROGITURL' refspec: '' @@ -203,14 +203,28 @@ wrappers: - jclouds: instances: - - rk-c7-java: - cloud-name: 'Rackspace DFW - Integration Dynamic Lab' + - '{controller-image}': + cloud-name: 'ODLPUB' count: '{controller-vms}' - stop-on-terminate: False - '{mininet-image}': - cloud-name: '{mininet-cloud-name}' + cloud-name: 'ODLPUB' count: '{mininet-vms}' - stop-on-terminate: False + +# Macro: integration-openstack-controller-mininet +# Operation: this macro will spin the controller and mininet vms +# Used by: {project}-csit-* job templates + +- wrapper: + name: integration-openstack-controller-mininet + wrappers: + - openstack: + instances: + - cloud-name: 'ODLRPC' + template-name: '{controller-image}' + count: '{controller-vms}' + - cloud-name: 'ODLRPC' + template-name: '{mininet-image}' + count: '{mininet-vms}' # Macro: integration-jclouds-controller-devstack # Operation: this macro will spin the controller and devstack vms @@ -220,19 +234,69 @@ wrappers: - jclouds: instances: - - rk-c7-java: - cloud-name: 'Rackspace DFW - Integration Dynamic Lab' + - '{controller-image}': + cloud-name: 'ODLPUB' count: '{controller-vms}' - stop-on-terminate: False - - rk-c7-devstack: - cloud-name: 'Rackspace DFW - Devstack' + - '{openstack-image}': + cloud-name: 'ODLPUB' count: '{openstack-vms}' - stop-on-terminate: False + +# Macro: integration-openstack-controller-devstack +# Operation: this macro will spin the controller and devstack vms +# Used by: {project}-csit-openstack job templates +- wrapper: + name: integration-openstack-controller-devstack + wrappers: + - openstack: + instances: + - cloud-name: 'ODLRPC' + template-name: '{controller-image}' + count: '{controller-vms}' + - cloud-name: 'ODLRPC' + template-name: '{openstack-image}' + count: '{openstack-vms}' ################# # Shell Scripts # ################# +# Macro: integration-copy-ssh-keys +# Operation: Copy ssh public key used as authentication for robot +# Used by: {project}-csit-* job templates + +- builder: + name: integration-copy-ssh-keys + builders: + - shell: | + #!/bin/bash + function copy-ssh-keys-to-slave() { + RETRIES=30 + 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 "Successfully copied public keys to slave ${i}" + break + elif [ $j -eq $RETRIES ]; then + echo "SSH not responding on ${i} after $RETIRES tries. Giving up." + exit 1 + else + echo "SSH not responding on ${i}. Retrying in 10 seconds..." + sleep 10 + fi + done + } + + echo "OpenStack IPS are ${JCLOUDS_IPS}" + + IFS=',' read -ra ADDR <<< "${JCLOUDS_IPS}" + + for i in "${ADDR[@]}"; do + copy-ssh-keys-to-slave & + done + + wait + echo "Copying ssh keys complete." + # Macro: integration-get-slave-addresses # Operation: this macro gets the IP addresses of the dynamic vms # Used by: {project}-csit-* job templates @@ -299,17 +363,6 @@ !include-raw: - include-raw-integration-deploy-controller-run-test.sh -# Macro: include-raw-integration-deploy-robot-testing -# Operation: this macro only resolves suite path from testplan -# Used by: {project}-openstack-{functionality}-daily-{openstack}-{odl} job templates - -- builder: - name: include-raw-integration-deploy-devstack-testing - builders: - - shell: - !include-raw: - - include-raw-integration-deploy-devstack-testing.sh - # Macro: integration-configure-clustering # Operation: this macro configures the clustering # Used by: {project}-csit-3node-* job templates @@ -432,3 +485,18 @@ unstable-threshold: '{unstable-if}' pass-threshold: '{pass-if}' only-critical: false + +- publisher: + name: integration-csit-archive-build + publishers: + - postbuildscript: + builders: + - shell: | + #!/bin/bash + 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 + script-only-if-succeeded: False + script-only-if-failed: False + mark-unstable-if-failed: True