From ead0ef69879ccdbe40c6997bd399d88b32728add Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Thu, 9 Feb 2017 10:14:08 -0500 Subject: 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: ' 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 --- jjb/apex/apex-deploy.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'jjb/apex/apex-deploy.sh') 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: '" + exit 1 + else + echo "Gate scenario detected: ${DEPLOY_SCENARIO}" + fi + fi fi # use local build for verify and csit promote -- cgit 1.2.3-korg