Skip to content
Snippets Groups Projects

Update main.sh fix remove of docker images in case of test failures, and latest image

Merged Domenico Giordano requested to merge BMK-122 into qa
1 file
+ 7
1
Compare changes
  • Side-by-side
  • Inline
+ 7
1
@@ -324,7 +324,12 @@ function test_standalone_image(){
if [ "$MAIN_NETWORKCONN" == "1" ]; then net_conn=""; fi
###strace="--cap-add SYS_PTRACE" # optionally add SYS_PTRACE capability to use strace (see https://github.com/moby/moby/issues/21051)
echo -e "\n[test_standalone_image] Run WL in docker (to test the image) via execute_command - started"
execute_command docker run ${strace} ${net_conn} --rm -v $CIENV_JOBDIR/results:/results $theimage $HEPWL_BMKOPTS || fail "[test_standalone_image] docker run $theimage"
execute_command docker run ${strace} ${net_conn} --rm -v $CIENV_JOBDIR/results:/results $theimage $HEPWL_BMKOPTS
status=$?
if [[ "$status" -ne "0" ]]; then
docker rmi -f $theimage #see BMK-122
fail "[test_standalone_image] docker run $theimage"
fi
echo -e "[test_standalone_image] Run WL in docker (to test the image) via execute_command - completed\n"
## NB THE LINE BELOW WILL BE MOVED ELSEWHERE
test_in_singularity || fail "[test_standalone_image] test_in_singularity"
@@ -356,6 +361,7 @@ function publish_standalone_image(){
theimage_latest=${CIENV_DOCKERREGISTRY}/${HEPWL_DOCKERIMAGENAME}:latest
docker tag "${theimage}" "${theimage_latest}" || fail "[publish_standalone_image] docker tag ${theimage} ${theimage_latest}"
docker push "${theimage_latest}" || fail "[publish_standalone_image] docker push ${theimage_latest}"
docker rmi "${theimage_latest}" #BMK-122 cleaning the local tag latest to free up space
fi
if [ -z $HEPWL_BMKANNOUNCE ] || [ "${HEPWL_BMKANNOUNCE,,}" != "false" ]; then
announce "${theimage}"
Loading