Skip to content

Commit

Permalink
Make sure we do not exit on error, instead just log it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinakar Guniguntala committed Mar 17, 2020
1 parent e58b77e commit 8e17b7d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
3 changes: 2 additions & 1 deletion build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ do

err=$?
if [ ${err} != 0 ] || [ ! -f ./push_commands.sh ]; then
echo "#############################################"
echo
echo "ERROR: Docker Build for version ${ver} failed."
echo
exit 1;
echo "#############################################"
fi
echo
echo "WARNING: Pushing to AdoptOpenJDK repo on hub.docker.com"
Expand Down
5 changes: 4 additions & 1 deletion build_latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ function build_image() {
echo "#####################################################"
# shellcheck disable=SC2086 # ignoring ${tags} due to whitespace problem
if ! docker build --pull --no-cache ${tags} -f "${dockerfile}" . ; then
echo "#############################################"
echo
echo "ERROR: Docker build of image: ${tags} from ${dockerfile} failed."
exit 1
echo
echo "#############################################"
fi
}

Expand Down
3 changes: 2 additions & 1 deletion test_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ do

err=$?
if [ ${err} != 0 ]; then
echo "#############################################"
echo
echo "ERROR: Docker test for version ${ver} failed."
echo
exit 1;
echo "#############################################"
fi
done
done
Expand Down
20 changes: 12 additions & 8 deletions test_multiarch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ function test_java_version() {
echo "TEST: Running java -version test on image: ${img}..."
# Don't use "-it" flags as the jenkins job doesn't have a tty
if ! docker run --rm "${img}" java -version; then
printf "ERROR: Docker Image %s failed the java -version test\n" "${img}"
exit 1
printf "\n##############################################\n"
printf "\nERROR: Docker Image %s failed the java -version test\n" "${img}"
printf "\n##############################################\n"
fi
echo
}
Expand All @@ -71,8 +72,9 @@ function test_aliases() {
echo -n "INFO: Pulling image: ${target_repo}:${arch_tag}..."
ret=$(check_image "${target_repo}":"${arch_tag}")
if [ "${ret}" != 0 ]; then
printf "Error: Docker Image %s not found on hub.docker\n" "${img}"
exit 1
printf "\n##############################################\n"
printf "\nError: Docker Image %s not found on hub.docker\n" "${img}"
printf "\n##############################################\n"
fi
done

Expand All @@ -82,8 +84,9 @@ function test_aliases() {
echo -n "INFO: Pulling image: ${target_repo}:${tag_alias}..."
ret=$(check_image "${target_repo}":"${tag_alias}")
if [ "${ret}" != 0 ]; then
printf "Error: Docker Image %s not found on hub.docker\n" "${img}"
exit 1
printf "\n##############################################\n"
printf "\nError: Docker Image %s not found on hub.docker\n" "${img}"
printf "\n##############################################\n"
fi
run_tests "${target_repo}":"${tag_alias}"
done
Expand All @@ -105,8 +108,9 @@ function test_tags() {
echo -n "INFO: Pulling image: ${target_repo}:${arch_tag}..."
ret=$(check_image "${target_repo}":"${arch_tag}")
if [ "${ret}" != 0 ]; then
printf "Error: Docker Image %s not found on hub.docker\n" "${img}"
exit 1
printf "\n##############################################\n"
printf "\nError: Docker Image %s not found on hub.docker\n" "${img}"
printf "\n##############################################\n"
fi
run_tests "${target_repo}":"${arch_tag}"
done
Expand Down
3 changes: 2 additions & 1 deletion update_manifest_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ do

err=$?
if [ ${err} != 0 ] || [ ! -f ./manifest_commands.sh ]; then
echo "#############################################"
echo
echo "ERROR: Docker Build for version ${ver} failed."
echo
exit 1;
echo "#############################################"
fi
echo
echo "WARNING: Pushing to AdoptOpenJDK repo on hub.docker.com"
Expand Down

0 comments on commit 8e17b7d

Please sign in to comment.