From dc0d54fbdaa21ebfb2e637116453b09213539acf Mon Sep 17 00:00:00 2001 From: Maksym Mishchanchuk Date: Mon, 24 Apr 2023 16:14:18 +0300 Subject: [PATCH] Tune build script Signed-off-by: Maksym Mishchanchuk --- build.sh | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/build.sh b/build.sh index 9cb10d6a..b1474633 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,5 @@ #!/bin/bash -NEED_PUSH=0 - if ! command -v jq &> /dev/null then echo "'jq' could not be found. Please install this utility" @@ -20,13 +18,6 @@ then exit fi -if [ -z "$3" ] || [ "$3" != "1" ] || [ "$3" != "0" ] -then - echo "Package will not push to docker registry" -else - NEED_PUSH=$3 -fi - mv package.json pkg-temp.json jq --arg vs "$1" -r '. + {dev:false, version:$vs}' pkg-temp.json > package.json rm pkg-temp.json @@ -35,11 +26,11 @@ cat package.json docker build -f dev/build/Dockerfile -t "$2:$1" . docker tag "$2:$1" "$2:latest" -if [ "$NEED_PUSH" == "1" ] +if [ "$3" == "1" ] then echo "Pushing to docker registry" -# docker push "$2:$1" -# docker push "$2:latest" + docker push "$2:$1" + docker push "$2:latest" else echo "Skipping push images to docker registry" fi