From: jose.lausuch Date: Wed, 28 Oct 2015 16:46:08 +0000 (+0100) Subject: Reversed: Added reset to rally commit ID in prepare_env.sh X-Git-Tag: 0.2~1925 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=1a145e36361420713f1497291e79ff3f65d80cc5;p=functest-xtesting.git Reversed: Added reset to rally commit ID in prepare_env.sh I did not realized it was correct, however there was a small bug. The rally repo git reset command is done after the if-else clause. Change-Id: Ia6f61ae3a3d09a5148cfbea7c47cf317fd949c11 Signed-off-by: jose.lausuch --- diff --git a/docker/prepare_env.sh b/docker/prepare_env.sh index 493f2f88..454ba4e3 100755 --- a/docker/prepare_env.sh +++ b/docker/prepare_env.sh @@ -108,10 +108,7 @@ if [ $offline == false ]; then fi info "Rally repo: pulling to latest..." git pull - if [ ${RALLY_COMMIT} != "latest" ]; then - info "Rally repo: given commit is ${RALLY_COMMIT}. Reseting..." - git reset --hard ${RALLY_COMMIT} - fi + # We leave the reset command for later. info "Updating vIMS test repository...." cd ${VIMS_REPO_DIR} @@ -129,7 +126,9 @@ if [ $offline == false ]; then fi # We do this regardless if its online or offline mode. +# Assumption: the docker image contains a newer rally repo than the given commit. if [ ${RALLY_COMMIT} != "latest" ]; then + cd ${RALLY_REPO_DIR} info "Rally repo: given commit is ${RALLY_COMMIT}. Reseting..." git reset --hard ${RALLY_COMMIT} fi