summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2017-02-09 10:14:08 -0500
committerTim Rozet <trozet@redhat.com>2017-02-09 10:49:52 -0500
commitead0ef69879ccdbe40c6997bd399d88b32728add (patch)
treebd1a1056944ff465c85dad252bdd9282f95fc522
parent06c5973767bb31c0fdc640bce06ebf09b98f3e2e (diff)
Apex: Adds gate scenario job
Apex needs a way to run a gate job after basic scenarios (nosdn, odl-nofeature) pass. We need the capability to specify which scenario should be the gate. This patch allows us via a comment to specify 'start-gate-scenario: <scenario>' which will start a gate job to validate that scenario deploys and passes basic functest health check. Some drawbacks of this approach include only being able to validate a single scenario per comment + gerrit votes overriding (not true workflow/pipeline plugin). The positive is this is a fairly small CI change to enable some much needed verification. It will be the Apex committers responsibility to issue this comment post Jenkins +1 approval of pre-gate. Change-Id: I9a1364bb1cece8b35488d496789a5e83c707b32d Signed-off-by: Tim Rozet <trozet@redhat.com>
-rwxr-xr-xjjb/apex/apex-deploy.sh15
-rw-r--r--jjb/apex/apex.yml81
2 files changed, 96 insertions, 0 deletions
diff --git a/jjb/apex/apex-deploy.sh b/jjb/apex/apex-deploy.sh
index 31c1bed5f..790d2a3aa 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
diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml
index 512112e42..07da97a53 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,85 @@
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
+ 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}'