Skip to content

Commit f3782d0

Browse files
Merge pull request #630 from PeterYurkovich/set-push-as-default
NO-JIRA: Set push as default image-build behavior
2 parents b202904 + 23d9067 commit f3782d0

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

scripts/build-image.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -euo pipefail
44

55
PREFER_PODMAN="${PREFER_PODMAN:-1}"
6-
PUSH="${PUSH:-0}"
6+
PUSH="${PUSH:-1}"
77
TAG="${TAG:-v1.0.0}"
88
REGISTRY_ORG="${REGISTRY_ORG:-openshift-observability-ui}"
99
DOCKER_FILE_NAME="${DOCKER_FILE_NAME:-Dockerfile.dev}"
@@ -12,12 +12,12 @@ REPO="${REPO:-monitoring-plugin}"
1212
# Define ANSI color codes
1313
RED='\033[0;31m'
1414
GREEN='\033[0;32m'
15-
ENDCOLOR='\033[0m'
15+
ENDCOLOR='\033[0m'
1616

17-
# Prompt user for TAG
17+
# Prompt user for TAG
1818
read -p "$(echo -e "${RED}Enter a value for TAG [${TAG}]: ${ENDCOLOR}")" USER_TAG
1919
if [ -n "$USER_TAG" ]; then
20-
TAG="$USER_TAG"
20+
TAG="$USER_TAG"
2121
fi
2222

2323
if [[ -x "$(command -v podman)" && $PREFER_PODMAN == 1 ]]; then
@@ -41,10 +41,9 @@ echo_vars() {
4141
}
4242
echo_vars
4343

44-
# Prompt use it check env vars before proceeding to build
44+
# Prompt use it check env vars before proceeding to build
4545
read -r -p "Are the environmental variables correct [y/N] " response
46-
if [[ "${response:0:1}" =~ ^([nN])$ ]]
47-
then
46+
if [[ "${response:0:1}" =~ ^([nN])$ ]]; then
4847
exit 0
4948
fi
5049

@@ -55,6 +54,6 @@ make lint-backend
5554
echo -e "${GREEN} Building image '${IMAGE}' with ${OCI_BIN} ${ENDCOLOR}"
5655
$OCI_BIN build -t $IMAGE --platform=linux/amd64 -f $DOCKER_FILE_NAME .
5756

58-
if [[ $PUSH == 1 ]]; then
57+
if [[ $PUSH == 1 ]]; then
5958
$OCI_BIN push $IMAGE
6059
fi

0 commit comments

Comments
 (0)