diff options
author | Fatih Degirmenci <fdegir@gmail.com> | 2018-02-26 11:58:24 +0000 |
---|---|---|
committer | Fatih Degirmenci <fdegir@gmail.com> | 2018-02-26 12:20:15 +0000 |
commit | 375ecea18576cb947ba8ea40218a35ab0c9709c8 (patch) | |
tree | 01039acc53b312a29c4336dcafc6747e7783a304 /jjb/xci/xci-start-new-vm.sh | |
parent | 90f5aa7749149fb0fc1a886133e3e761404330fc (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/xci/xci-start-new-vm.sh')
-rwxr-xr-x | jjb/xci/xci-start-new-vm.sh | 11 |
1 files changed, 11 insertions, 0 deletions
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 |