Tune build script

Signed-off-by: Maksym Mishchanchuk <maksym.mishchanchuk@splynx.com>
pull/7149/head
Maksym Mishchanchuk 3 years ago
parent 91407e2710
commit dc0d54fbda

@ -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

Loading…
Cancel
Save