Reversed: Added reset to rally commit ID in prepare_env.sh
authorjose.lausuch <jose.lausuch@ericsson.com>
Wed, 28 Oct 2015 16:46:08 +0000 (17:46 +0100)
committerjose.lausuch <jose.lausuch@ericsson.com>
Wed, 28 Oct 2015 16:46:08 +0000 (17:46 +0100)
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 <jose.lausuch@ericsson.com>
docker/prepare_env.sh

index 493f2f8..454ba4e 100755 (executable)
@@ -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