Skip to content

Commit

Permalink
Merge pull request #12 from tnelson-doghouse/exit-with-error-1
Browse files Browse the repository at this point in the history
Modified script to exit with error when there's an error building the new image, instead of continuing willy-nilly
  • Loading branch information
shreddedbacon authored Oct 27, 2024
2 parents 68e5732 + eec87fd commit c26780d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mariadb-image-builder
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,11 @@ done
# BACKUP_IMAGE_TAG is optional and will default to `backup-${date}`
# these have to be the same base `mariadb` version to work (ie mariadb:10.6 as the builder, and uselagoon/mariadb-10.6-drupal:latest as the clean resulting image)

# build the image
# build the image, but exit on error
ln -s mariadb.Dockerfile Dockerfile
set -o errexit
docker build --network=host --build-arg BUILDER_IMAGE="${BUILDER_IMAGE_NAME}" --build-arg CLEAN_IMAGE="${BUILDER_CLEAN_IMAGE_NAME}" -t ${backup_image_full} -t "${BUILDER_BACKUP_IMAGE_NAME}:latest" .
set +o errexit

##### Phase 4: Save new container to registry

Expand Down

0 comments on commit c26780d

Please sign in to comment.