diff --git a/.gitlab-ci.sh b/.gitlab-ci.sh index 7ff431db339396bd4f52d5f5b4d2e7b8f562a3ad..41e1fe188f9fce37974b5aab1ef365e783516f98 100755 --- a/.gitlab-ci.sh +++ b/.gitlab-ci.sh @@ -22,7 +22,8 @@ elif [ "$1" == "test" ]; then else usage fi -echo "Executing $(basename $0) $stage script" + +echo -e "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n Executing $(basename $0) $stage script \n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n" # Display the current date and working directory date @@ -98,14 +99,20 @@ if [ "$stage" == "build" ]; then status=${PIPESTATUS[0]} # NB do not use $? if you pipe to tee... - #Create tarball of JOBDIR results - echo "creating tarball of json and log results for artifacts" - find $JOB_DIR/results -name "*.json" -or -name "*.log" | tar -cvzf $CI_PROJECT_DIR/results.tar.gz -T - + echo -e "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n Back to the CI $(basename $0) $stage script \n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n" + #Create tarball of JOBDIR results + echo -e "\n\n--------------\nCreating tarball of json and log results for artifacts\n--------------\n" + if [ -e $JOB_DIR/results ];then + find $JOB_DIR/results -name "*.json" -or -name "*.log" | tar -cvzf $CI_PROJECT_DIR/results.tar.gz -T - + else + echo -e "No such directory $JOB_DIR/results . Artifacts will be empty\n" + fi # Clean up: remove directory CVMFS_VOLUME # Also unmount cvmfs and delete mount points below CVMFS_VOLUME if necessary (but main.sh # in docker run should have already done this and CVMFS_VOLUME should be empty by now) if [ "$MOUNT_CVMFS" != "0" ]; then + echo -e "\n\n--------------\n Clean up CVMFS Volumes\n--------------\n" if [ ! -d ${CVMFS_VOLUME} ]; then echo "WARNING! Directory not found: $CVMFS_VOLUME" # e.g. symlink in /mnt, but /mnt not shared in the toml else @@ -126,10 +133,11 @@ if [ "$stage" == "build" ]; then fi # Clean up: clear old docker images + echo -e "\n\n--------------\n Clean up docker images\n--------------\n" $CI_PROJECT_DIR/test/clear_images.sh # Exit the CI with the return code of docker run - echo "Terminating with exit status $status" + echo -e "\n\nTerminating with exit status $status" exit $status # diff --git a/build-executor/main.sh b/build-executor/main.sh index dc7f4df6ab8dc5de12d1ce3e8db7a70be2f2422a..5f475fa17bcccccfd57f4996043a2dbbb35578e9 100755 --- a/build-executor/main.sh +++ b/build-executor/main.sh @@ -3,7 +3,7 @@ #set -e # immediate exit on error function fail(){ - echo "Failing '$@'" >&2 + echo -e "\n------------------------\nFailing '$@'\n------------------------\n" >&2 exit 1 } @@ -326,7 +326,7 @@ function check_tag_version(){ echo "[check_tag_version] tag $REFTAG has not other tag associated" else if (( $(echo "${thetag/v/} >= ${DOCKER_IMAGE_TAG/v/}" | bc -l) )); then - echo "[check_tag_version] new image tag ${DOCKER_IMAGE_TAG/v/} MUST be greater than tag $thetag associated to $IMAGE:$REFTAG" + echo -e "\n[check_tag_version] new image tag ${DOCKER_IMAGE_TAG/v/} MUST be greater than tag $thetag associated to $IMAGE:$REFTAG\n\n" return 1 fi fi