Skip to content

Commit

Permalink
Add a -y (assume yes) option to the build scripts
Browse files Browse the repository at this point in the history
This will be used by various workflows to automatically build and push images.
  • Loading branch information
rjuju committed Jun 16, 2024
1 parent bd271d7 commit 7730d02
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
BUILD_CMD = ./build_all.sh

ifneq ($(filter-out undefined, ${CONTAINER_PUSH} ${PODMAN_PUSH} ${DOCKER_PUSH}),)
BUILD_CMD += -p
endif

ifneq ($(filter-out undefined, ${CONTAINER_PUSH_YES}),)
BUILD_CMD += -y
endif

.PHONY: git git-misc powa-archivist powa-archivist-git powa-web-git powa-collector-git

all: powa-web-misc powa-collector-misc
Expand Down
18 changes: 13 additions & 5 deletions build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function usage {
echo " image. Requires usage of -i option, and only"
echo " supported for powa-archivist."
echo " -v Verbose mode"
echo " -y Assume yes"
}

DIRNAME="$(dirname $0)"
Expand All @@ -25,6 +26,7 @@ specific_subver=
noclean="false"
do_push="false"
quiet_flag="-q"
assume_yes="false"

while getopts "hi:nps:u:v" name; do
case "${name}" in
Expand Down Expand Up @@ -62,6 +64,9 @@ while getopts "hi:nps:u:v" name; do
v)
quiet_flag=""
;;
y)
assume_yes="true"
;;
*)
usage
exit 1
Expand Down Expand Up @@ -230,12 +235,15 @@ if [[ "${do_push}" == "true" ]]; then
fi
echo "==================================="
echo ""
echo "Build images ? [y/N]"
read cont

if [ "$cont" != "y" -a "$cont" != "Y" ]; then
echo "Stopping now"
exit 1
if [[ "${assume_yes}" != "true" ]]; then
echo "Build images ? [y/N]"
read cont

if [ "$cont" != "y" -a "$cont" != "Y" ]; then
echo "Stopping now"
exit 1
fi
fi

if should_be_built "powa-archivist"; then
Expand Down

0 comments on commit 7730d02

Please sign in to comment.