summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
authorFatih Degirmenci <fdegir@gmail.com>2018-02-26 11:58:24 +0000
committerFatih Degirmenci <fdegir@gmail.com>2018-02-26 12:20:15 +0000
commit375ecea18576cb947ba8ea40218a35ab0c9709c8 (patch)
tree01039acc53b312a29c4336dcafc6747e7783a304 /jjb
parent90f5aa7749149fb0fc1a886133e3e761404330fc (diff)
xci: Fix the Gerrit Trigger clone issue for external scenarios
When a patch comes in for an external scenario, Gerrit Trigger injects refs for that patch for the corresponding project. With the previous configuration, job attempts to get that patch for releng-xci instead of the actual project. But switching to the right project causes Jenkins jobs to fail since the releng-xci will not be checked out to WORKSPACE. This change makes the clone for the repo/patch work and then it wipes out the WORKSPACE and clones releng-xci there to get the actual script parts to work. Change-Id: Ide31c21a209dff953118f51e9b09de1d206a3085 Signed-off-by: Fatih Degirmenci <fdegir@gmail.com>
Diffstat (limited to 'jjb')
-rwxr-xr-xjjb/xci/xci-run-functest.sh11
-rwxr-xr-xjjb/xci/xci-set-scenario.sh11
-rwxr-xr-xjjb/xci/xci-start-new-vm.sh11
-rw-r--r--jjb/xci/xci-verify-jobs.yml16
4 files changed, 41 insertions, 8 deletions
diff --git a/jjb/xci/xci-run-functest.sh b/jjb/xci/xci-run-functest.sh
index b2421de32..7c639b75b 100755
--- a/jjb/xci/xci-run-functest.sh
+++ b/jjb/xci/xci-run-functest.sh
@@ -20,6 +20,17 @@ if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then
exit 0
fi
+# if the scenario is external, we need to wipe WORKSPACE to place releng-xci there since
+# the project where the scenario is coming from is cloned and the patch checked out to the
+# xci/scenarios/$DEPLOY_SCENARIO to be synched on clean VM
+# apart from that, we need releng-xci stuff in WORKSPACE for things to function correctly on Jenkins.
+# if the change is coming to releng-xci, we don't need to do anything since the patch is checked
+# out to the WORKSPACE anyways
+if [[ $GERRIT_PROJECT != "releng-xci" ]]; then
+ /bin/rm -rf $WORKSPACE
+ git clone https://gerrit.opnfv.org/gerrit/releng-xci $WORKSPACE
+fi
+
# skip the deployment if the scenario is not supported on this distro
OPNFV_SCENARIO_REQUIREMENTS=$WORKSPACE/xci/opnfv-scenario-requirements.yml
if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENTS | grep -q $DISTRO; then
diff --git a/jjb/xci/xci-set-scenario.sh b/jjb/xci/xci-set-scenario.sh
index 00ca95d45..3b3a0cfab 100755
--- a/jjb/xci/xci-set-scenario.sh
+++ b/jjb/xci/xci-set-scenario.sh
@@ -25,6 +25,17 @@ if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then
exit 0
fi
+# if the scenario is external, we need to wipe WORKSPACE to place releng-xci there since
+# the project where the scenario is coming from is cloned and the patch checked out to the
+# xci/scenarios/$DEPLOY_SCENARIO to be synched on clean VM
+# apart from that, we need releng-xci stuff in WORKSPACE for things to function correctly on Jenkins.
+# if the change is coming to releng-xci, we don't need to do anything since the patch is checked
+# out to the WORKSPACE anyways
+if [[ $GERRIT_PROJECT != "releng-xci" ]]; then
+ /bin/rm -rf $WORKSPACE
+ git clone https://gerrit.opnfv.org/gerrit/releng-xci $WORKSPACE
+fi
+
WORK_DIRECTORY=/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO
/bin/rm -rf $WORK_DIRECTORY && mkdir -p $WORK_DIRECTORY
diff --git a/jjb/xci/xci-start-new-vm.sh b/jjb/xci/xci-start-new-vm.sh
index b38ebe510..3cec4b3d2 100755
--- a/jjb/xci/xci-start-new-vm.sh
+++ b/jjb/xci/xci-start-new-vm.sh
@@ -20,6 +20,17 @@ if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
exit 0
fi
+# if the scenario is external, we need to wipe WORKSPACE to place releng-xci there since
+# the project where the scenario is coming from is cloned and the patch checked out to the
+# xci/scenarios/$DEPLOY_SCENARIO to be synched on clean VM
+# apart from that, we need releng-xci stuff in WORKSPACE for things to function correctly on Jenkins.
+# if the change is coming to releng-xci, we don't need to do anything since the patch is checked
+# out to the WORKSPACE anyways
+if [[ $GERRIT_PROJECT != "releng-xci" ]]; then
+ /bin/rm -rf $WORKSPACE
+ git clone https://gerrit.opnfv.org/gerrit/releng-xci $WORKSPACE
+fi
+
# skip the deployment if the scenario is not supported on this distro
OPNFV_SCENARIO_REQUIREMENTS=$WORKSPACE/xci/opnfv-scenario-requirements.yml
if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENTS | grep -q $DISTRO; then
diff --git a/jjb/xci/xci-verify-jobs.yml b/jjb/xci/xci-verify-jobs.yml
index 40e9ee388..da031c96d 100644
--- a/jjb/xci/xci-verify-jobs.yml
+++ b/jjb/xci/xci-verify-jobs.yml
@@ -129,7 +129,7 @@
parameters:
- project-parameter:
- project: '{project}'
+ project: $GERRIT_PROJECT
branch: '{branch}'
- label:
name: SLAVE_LABEL
@@ -142,7 +142,7 @@
default: 'true'
- string:
name: GIT_BASE
- default: https://gerrit.opnfv.org/gerrit/releng-xci
+ default: https://gerrit.opnfv.org/gerrit/$PROJECT
description: 'Git URL to use on this Jenkins Slave'
builders:
@@ -159,8 +159,8 @@
current-parameters: true
predefined-parameters: |
DISTRO={distro}
- DEPLOY_SCENARIO=os-nosdn-nofeature
CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
+ GERRIT_PROJECT=$GERRIT_PROJECT
GERRIT_BRANCH=$GERRIT_BRANCH
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
@@ -176,14 +176,14 @@
current-parameters: true
predefined-parameters: |
DISTRO={distro}
- DEPLOY_SCENARIO=os-nosdn-nofeature
CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
- FUNCTEST_MODE=tier
- FUNCTEST_TIER=healthcheck
+ GERRIT_PROJECT=$GERRIT_PROJECT
GERRIT_BRANCH=$GERRIT_BRANCH
GERRIT_REFSPEC=$GERRIT_REFSPEC
GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
+ FUNCTEST_MODE=tier
+ FUNCTEST_TIER=healthcheck
node-parameters: true
kill-phase-on: NEVER
abort-all-job: true
@@ -209,7 +209,7 @@
parameters:
- string:
name: PROJECT
- default: 'releng-xci'
+ default: $GERRIT_PROJECT
- string:
name: DISTRO
default: 'ubuntu'
@@ -236,7 +236,7 @@
default: 'osa'
- string:
name: GIT_BASE
- default: https://gerrit.opnfv.org/gerrit/releng-xci
+ default: https://gerrit.opnfv.org/gerrit/$PROJECT
description: 'Git URL to use on this Jenkins Slave'
wrappers: