1
0
Fork 0

feat(build): better error handling for image build

This commit is contained in:
Sean Sube 2022-02-06 13:22:22 -06:00
parent 86aeac5851
commit c9fd4f13bd
1 changed files with 3 additions and 3 deletions

View File

@ -11,17 +11,17 @@ IMAGE_FULL="${IMAGE_NAME}:${IMAGE_TAG}-${IMAGE_ARCH}"
echo "Building image: ${IMAGE_FULL}"
docker build -f "Dockerfile.${IMAGE_ARCH}" -t "${IMAGE_FULL}" .
docker build -f "Dockerfile.${IMAGE_ARCH}" -t "${IMAGE_FULL}" . || echo "Failed to build image!" && exit 1
if [[ "${IMAGE_PUSH}" == "--push" ]];
then
echo "Pushing image: ${IMAGE_FULL}"
docker push "${IMAGE_FULL}"
docker push "${IMAGE_FULL}" || echo "Failed to push image!" && exit 1
fi
if [[ "${IMAGE_DEFAULT}" == "--default" ]];
then
echo "Pushing image (default architecture): ${IMAGE_SHORT}"
docker tag "${IMAGE_FULL}" "${IMAGE_SHORT}"
docker push "${IMAGE_SHORT}"
docker push "${IMAGE_SHORT}" || echo "Failed to push image!" && exit 1
fi