diff --git a/devstack-vm-gate-wrap.sh b/devstack-vm-gate-wrap.sh index 331cf19b..07d260f3 100755 --- a/devstack-vm-gate-wrap.sh +++ b/devstack-vm-gate-wrap.sh @@ -292,7 +292,7 @@ tsfilter setup_host &> $WORKSPACE/logs/devstack-gate-setup-host.txt if [ "$DEVSTACK_GATE_GRENADE" -eq "1" -o "$DEVSTACK_GATE_GRENADE_FORWARD" -eq "1" ]; then echo "Setting up the new (migrate to) workspace" echo "... this takes 3 - 5 minutes (logs at logs/devstack-gate-setup-workspace-new.txt.gz)" - tsfilter setup_workspace $GRENADE_NEW_BRANCH $BASE/new &> \ + tsfilter setup_workspace $GRENADE_NEW_BRANCH $BASE/new copycache &> \ $WORKSPACE/logs/devstack-gate-setup-workspace-new.txt echo "Setting up the old (migrate from) workspace ..." echo "... this takes 3 - 5 minutes (logs at logs/devstack-gate-setup-workspace-old.txt.gz)" diff --git a/functions.sh b/functions.sh index c3b80015..8ff1db86 100644 --- a/functions.sh +++ b/functions.sh @@ -271,6 +271,7 @@ function re_exec_devstack_gate { function setup_workspace { local base_branch=$1 local DEST=$2 + local copy_cache=$3 local xtrace=$(set +o | grep xtrace) # Enabled detailed logging, since output of this function is redirected @@ -298,9 +299,15 @@ function setup_workspace { # It's important we are back at DEST for the rest of the script cd $DEST - # The vm template update job should cache some images in ~/cache. - # Move them to where devstack expects: - find ~/cache/files/ -mindepth 1 -maxdepth 1 -exec mv {} $DEST/devstack/files/ \; + if [ -n "$copy_cache" ] ; then + # The vm template update job should cache some images in ~/cache. + # Move them to where devstack expects: + find ~/cache/files/ -mindepth 1 -maxdepth 1 -exec cp {} $DEST/devstack/files/ \; + else + # The vm template update job should cache some images in ~/cache. + # Move them to where devstack expects: + find ~/cache/files/ -mindepth 1 -maxdepth 1 -exec mv {} $DEST/devstack/files/ \; + fi # Disable detailed logging as we return to the main script $xtrace