diff options
Diffstat (limited to 'jjb/apex')
-rwxr-xr-x | jjb/apex/apex-deploy.sh | 25 | ||||
-rw-r--r-- | jjb/apex/apex-snapshot-create.sh | 16 | ||||
-rwxr-xr-x | jjb/apex/apex-upload-artifact.sh | 2 | ||||
-rw-r--r-- | jjb/apex/apex.yml | 114 |
4 files changed, 148 insertions, 9 deletions
diff --git a/jjb/apex/apex-deploy.sh b/jjb/apex/apex-deploy.sh index 9535e7fb7..b68225f15 100755 --- a/jjb/apex/apex-deploy.sh +++ b/jjb/apex/apex-deploy.sh @@ -62,6 +62,21 @@ fi if [ -z "$DEPLOY_SCENARIO" ]; then echo "Deploy scenario not set!" exit 1 +elif [[ "$DEPLOY_SCENARIO" == *gate* ]]; then + echo "Detecting Gating scenario..." + if [ -z "$GERRIT_EVENT_COMMENT_TEXT" ]; then + echo "ERROR: Gate job triggered without comment!" + exit 1 + else + DEPLOY_SCENARIO=$(echo ${GERRIT_EVENT_COMMENT_TEXT} | grep start-gate-scenario | grep -Eo 'os-.*$') + if [ -z "$DEPLOY_SCENARIO" ]; then + echo "ERROR: Unable to detect scenario in Gerrit Comment!" + echo "Format of comment to trigger gate should be 'start-gate-scenario: <scenario>'" + exit 1 + else + echo "Gate scenario detected: ${DEPLOY_SCENARIO}" + fi + fi fi # use local build for verify and csit promote @@ -203,6 +218,16 @@ fi # start deployment sudo ${DEPLOY_CMD} -d ${DEPLOY_FILE} -n ${NETWORK_FILE} --debug +if [[ "$JOB_NAME" == *csit* ]]; then + echo "CSIT job: setting host route for floating ip routing" + # csit route to allow docker container to reach floating ips + UNDERCLOUD=$(sudo virsh domifaddr undercloud | grep -Eo "[0-9\.]+{3}[0-9]+") + if sudo route | grep 192.168.37.128 > /dev/null; then + sudo route del -net 192.168.37.128 netmask 255.255.255.128 + fi + sudo route add -net 192.168.37.128 netmask 255.255.255.128 gw ${UNDERCLOUD} +fi + echo echo "--------------------------------------------------------" echo "Done!" diff --git a/jjb/apex/apex-snapshot-create.sh b/jjb/apex/apex-snapshot-create.sh index 09c6a1197..f146dd810 100644 --- a/jjb/apex/apex-snapshot-create.sh +++ b/jjb/apex/apex-snapshot-create.sh @@ -26,17 +26,18 @@ mkdir -p ${tmp_dir} pushd ${tmp_dir} > /dev/null echo "Copying overcloudrc and ssh key from Undercloud..." # Store overcloudrc -UNDERCLOUD=$(sudo virsh domifaddr undercloud | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]') -scp ${SSH_OPTIONS[@]} stack@${UNDERCLOUD}:overcloudrc ./ +UNDERCLOUD=$(sudo virsh domifaddr undercloud | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+') +sudo scp ${SSH_OPTIONS[@]} stack@${UNDERCLOUD}:overcloudrc ./ # Copy out ssh key of stack from undercloud -scp ${SSH_OPTIONS[@]} stack@${UNDERCLOUD}:.ssh/id_rsa ./ +sudo scp ${SSH_OPTIONS[@]} stack@${UNDERCLOUD}:.ssh/id_rsa ./ popd > /dev/null echo "Gathering introspection information" git clone https://gerrit.opnfv.org/gerrit/sdnvpn.git pushd sdnvpn/odl-pipeline/lib > /dev/null -./tripleo_introspector.sh --out-file ${tmp_dir}/node.yaml +sudo ./tripleo_introspector.sh --out-file ${tmp_dir}/node.yaml popd > /dev/null +sudo rm -rf sdnvpn echo "Shutting down nodes" # Shut down nodes @@ -63,10 +64,11 @@ for node in $nodes; do fi done +pushd ${tmp_dir} > /dev/null echo "Gathering virsh definitions" # copy qcow2s, virsh definitions for node in $nodes; do - cp -f /var/lib/libvirt/images/${node}.qcow2 ./ + sudo cp -f /var/lib/libvirt/images/${node}.qcow2 ./ sudo virsh dumpxml ${node} > ${node}.xml done @@ -75,11 +77,13 @@ for net in admin api external storage tenant; do sudo virsh net-dumpxml ${net} > ${net}.xml done +sudo chown jenkins-ci:jenkins-ci * + # tar up artifacts DATE=`date +%Y-%m-%d` tar czf ../apex-csit-snap-${DATE}.tar.gz . popd > /dev/null -rm -rf ./.tmp +sudo rm -rf ${tmp_dir} echo "Snapshot saved as apex-csit-snap-${DATE}.tar.gz" # update opnfv properties file diff --git a/jjb/apex/apex-upload-artifact.sh b/jjb/apex/apex-upload-artifact.sh index 89fd5ed36..ef8ad5329 100755 --- a/jjb/apex/apex-upload-artifact.sh +++ b/jjb/apex/apex-upload-artifact.sh @@ -81,7 +81,7 @@ uploadsnap () { echo "Upload complete for Snapshot" } -if grep csit $WORKSPACE; then +if echo $WORKSPACE | grep csit > /dev/null; then uploadsnap elif gpg2 --list-keys | grep "opnfv-helpdesk@rt.linuxfoundation.org"; then echo "Signing Key avaliable" diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index fcf08ed86..e3f0f53bc 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -2,6 +2,7 @@ name: apex jobs: - 'apex-verify-{stream}' + - 'apex-verify-gate-{stream}' - 'apex-verify-unit-tests-{stream}' - 'apex-runner-{platform}-{scenario}-{stream}' - 'apex-runner-cperf-{stream}' @@ -45,6 +46,7 @@ - 'os-odl_l3-fdio_dvr-ha' - 'os-odl_l3-csit-noha' - 'os-onos-nofeature-ha' + - 'gate' platform: - 'baremetal' @@ -206,6 +208,86 @@ same-node: true - 'apex-workspace-cleanup' +# Verify Scenario Gate +- job-template: + name: 'apex-verify-gate-{stream}' + + node: '{verify-slave}' + + concurrent: true + + parameters: + - apex-parameter: + gs-pathname: '{gs-pathname}' + - project-parameter: + project: '{project}' + branch: '{branch}' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: "Used for overriding the GIT URL coming from parameters macro." + + scm: + - git-scm-gerrit + + triggers: + - gerrit: + server-name: 'gerrit.opnfv.org' + trigger-on: + - comment-added-contains-event: + comment-contains-value: '^Patch Set [0-9]+: Code-Review\+2.*start-gate-scenario:.*' + projects: + - project-compare-type: 'ANT' + project-pattern: 'apex' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: ANT + pattern: 'ci/**' + - compare-type: ANT + pattern: 'build/**' + - compare-type: ANT + pattern: 'lib/**' + - compare-type: ANT + pattern: 'config/**' + + properties: + - logrotate-default + - build-blocker: + use-build-blocker: true + block-level: 'NODE' + blocking-jobs: + - 'apex-daily.*' + - 'apex-deploy.*' + - 'apex-build.*' + - 'apex-runner.*' + - 'apex-verify.*' + - throttle: + max-per-node: 1 + max-total: 10 + option: 'project' + + builders: + - 'apex-build' + - trigger-builds: + - project: 'apex-deploy-virtual-gate-{stream}' + predefined-parameters: | + BUILD_DIRECTORY=apex-verify-gate-{stream} + OPNFV_CLEAN=yes + current-parameters: true + git-revision: false + block: true + same-node: true + - trigger-builds: + - project: 'functest-apex-{verify-slave}-suite-{stream}' + predefined-parameters: | + DEPLOY_SCENARIO=os-nosdn-nofeature-ha + FUNCTEST_SUITE_NAME=healthcheck + block: true + same-node: true + - 'apex-workspace-cleanup' + - job-template: name: 'apex-runner-{platform}-{scenario}-{stream}' @@ -560,8 +642,36 @@ build-step-failure-threshold: 'never' failure-threshold: 'never' unstable-threshold: 'FAILURE' - - + - trigger-builds: + - project: 'apex-deploy-baremetal-os-odl-bgpvpn-ha-{stream}' + predefined-parameters: | + BUILD_DIRECTORY=apex-build-{stream}/.build + OPNFV_CLEAN=yes + git-revision: true + same-node: true + block-thresholds: + build-step-failure-threshold: 'never' + block: true + - trigger-builds: + - project: 'functest-apex-{daily-slave}-daily-{stream}' + predefined-parameters: + DEPLOY_SCENARIO=os-odl-bgpvpn-ha + block: true + same-node: true + block-thresholds: + build-step-failure-threshold: 'never' + failure-threshold: 'never' + unstable-threshold: 'FAILURE' + - trigger-builds: + - project: 'yardstick-apex-{slave}-daily-{stream}' + predefined-parameters: + DEPLOY_SCENARIO=os-odl-bgpvpn-ha + block: true + same-node: true + block-thresholds: + build-step-failure-threshold: 'never' + failure-threshold: 'never' + unstable-threshold: 'FAILURE' # Colorado Build - job-template: name: 'apex-build-colorado' |