Merge "Add parameters in init function"
[releng.git] / jjb / dovetail / dovetail-run.sh
index 2c85e46..098b7db 100755 (executable)
@@ -34,14 +34,26 @@ fi
 
 opts="--privileged=true --rm"
 envs="-e CI_DEBUG=${CI_DEBUG} \
-      -v /var/run/docker.sock:/var/run/docker.sock"
+      -e INSTALLER_TYPE=${INSTALLER_TYPE} \
+      -e INSTALLER_IP=${INSTALLER_IP} \
+      -e DEPLOY_SCENARIO=${DEPLOY_SCENARIO} \
+      -e DEPLOY_TYPE=${DEPLOY_TYPE} \
+      -v /var/run/docker.sock:/var/run/docker.sock \
+      -v /home/opnfv/dovetail/results:/home/opnfv/dovetail/results"
 
 # Pull the image with correct tag
 echo "Dovetail: Pulling image opnfv/dovetail:${DOCKER_TAG}"
 docker pull opnfv/dovetail:$DOCKER_TAG >$redirect
 
 # Run docker
+echo "Dovetail: docker running..."
 sudo docker run ${opts} ${envs} ${labconfig} ${sshkey} opnfv/dovetail:${DOCKER_TAG} \
-"/home/opnfv/dovetail/scripts/run.py"
+"/home/opnfv/dovetail/dovetail/run.py"
+
+echo "Dovetail: store results..."
+sudo cp -r /home/opnfv/dovetail/results ./
+#To make sure the file owner is jenkins, for the copied results files in the above line
+#if not, there will be error when next time to wipe workspace
+sudo chown -R jenkins:jenkins ${WORKSPACE}/results
 
 echo "Dovetail: done!"