parameters:
- string:
name: DISTROGITURL
- default: 'ssh://jenkins-$SILO@git.opendaylight.org:29418/integration/distribution'
+ default: '{git-url}/integration/distribution'
description: 'Distribution GIT URL (do not modify)'
- parameter:
skip-tag: true
# Macro: integration-trigger-patch-submitted
-# Operation: this macro sets a trigger for patch submitted on a path pattern
-# Used by: {project}-verify-csit-* job templates
-
+# This is a single macro to use for all csit jobs who vote on every (relevant) patch set.
+# Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
+# in order to prevent Jenkins from starting only a subset and still voting Verified+1.
+# Contrary to gerrit-trigger-patch-submitted, this votes +1 also on unstable runs.
+# Arguments:
+# server: name of gerrit server to listen to
+# project: pattern to match triggering projects
+# branch: triggering branch name
+# files: pattern to match triggering filepaths
- trigger:
name: integration-trigger-patch-submitted
triggers:
- gerrit:
- server-name: 'OpenDaylight'
+ server-name: '{server}'
trigger-on:
- patchset-created-event:
exclude-drafts: 'true'
- draft-published-event
- comment-added-contains-event:
comment-contains-value: 'recheck'
- - comment-added-contains-event:
- comment-contains-value: 'reverify'
override-votes: true
gerrit-build-unstable-verified-value: +1
gerrit-build-unstable-codereview-value: 0
projects:
- - project-compare-type: 'ANT'
- project-pattern: '{name}'
- branches:
- - branch-compare-type: 'ANT'
- branch-pattern: '**/{branch}'
- file-paths:
- - compare-type: 'ANT'
- pattern: '{pattern}'
-
-# Macro: integration-trigger-patch-merged
-# Operation: this macro sets a trigger for patch merged on a path pattern
-# Used by: not used yet
-
-- trigger:
- name: integration-trigger-patch-merged
- triggers:
- - gerrit:
- server-name: 'OpenDaylight'
- trigger-on:
- - change-merged-event
- - comment-added-contains-event:
- comment-contains-value: 'remerge'
- projects:
- - project-compare-type: 'ANT'
- project-pattern: '{name}'
- branches:
- - branch-compare-type: 'ANT'
- branch-pattern: '**/{branch}'
- file-paths:
- - compare-type: 'ANT'
- pattern: '{pattern}'
+ - project-compare-type: 'ANT'
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: 'ANT'
+ branch-pattern: '**/{branch}'
+ file-paths:
+ - compare-type: 'ANT'
+ pattern: '{files}'
# Macro: integration-csit-only
# Operation: this macro sets a trigger on reverse job list
triggers:
- timed: 'H H * * *'
-# Macro: integration-jclouds-controller-mininet
-# Operation: this macro will spin the controller and mininet vms
-# Used by: {project}-csit-* job templates
-
-- wrapper:
- name: integration-jclouds-controller-mininet
- wrappers:
- - jclouds:
- instances:
- - '{controller-image}':
- cloud-name: 'ODLPUB'
- count: '{controller-vms}'
- - '{mininet-image}':
- cloud-name: 'ODLPUB'
- count: '{mininet-vms}'
-
# Macro: integration-openstack-controller-mininet
# Operation: this macro will spin the controller and mininet vms
# Used by: {project}-csit-* job templates
template-name: '{mininet-image}'
count: '{mininet-vms}'
-# Macro: integration-jclouds-controller-devstack
-# Operation: this macro will spin the controller and devstack vms
-# Used by: {project}-csit-openstack job templates
-- wrapper:
- name: integration-jclouds-controller-devstack
- wrappers:
- - jclouds:
- instances:
- - '{controller-image}':
- cloud-name: 'ODLPUB'
- count: '{controller-vms}'
- - '{openstack-image}':
- cloud-name: 'ODLPUB'
- count: '{openstack-vms}'
-
# Macro: integration-openstack-controller-devstack
# Operation: this macro will spin the controller and devstack vms
# Used by: {project}-csit-openstack job templates
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 #
#################
-# Macro: integration-copy-ssh-keys
-# Operation: Copy ssh public key used as authentication for robot
+# Macro: integration-infra-stack
+# Operation: Sets environment and then calls opendaylight-infra-stack to spin
+# up csit lab using openstack-heat.
# Used by: {project}-csit-* job templates
- builder:
- name: integration-copy-ssh-keys
+ name: integration-infra-stack
builders:
+ - integration-cleanup-workspace
- shell: |
#!/bin/bash
- function copy-ssh-keys-to-slave() {
- 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 "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}"
- pids=""
- for i in "${ADDR[@]}"; do
- ( copy-ssh-keys-to-slave ) &
- # Store PID of process
- pids+=" $!"
- done
-
- # 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."
+ # Setup openstack envirnoment file for use by
+ # the opendaylight-infra-stack macro
+ cat > $WORKSPACE/opendaylight-infra-environment.yaml << EOF
+ parameters:
+ vm_0_count: {vm_0_count}
+ vm_0_flavor: {vm_0_flavor}
+ vm_0_image: {vm_0_image}
+ vm_1_count: {vm_1_count}
+ vm_1_flavor: {vm_1_flavor}
+ vm_1_image: {vm_1_image}
+ EOF
+ echo "Contents of opendaylight-infra-environment.yaml ..."
+ cat $WORKSPACE/opendaylight-infra-environment.yaml
+ - opendaylight-infra-stack:
+ stack-template: '{stack-template}'
# Macro: integration-get-slave-addresses
# Operation: this macro gets the IP addresses of the dynamic vms
!include-raw:
- include-raw-integration-multipatch-distribution-test.sh
-# Macro: integration-cleanup-worspace
+# Macro: integration-cleanup-workspace
# Operation: Cleans up files possibly left there by the previous build
# Used by: {project}-csit-* job templates
builders:
- shell: |
#!/bin/bash
- mkdir $WORKSPACE/archives
+ mkdir -p $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