Build scripts refactoring (#33)

* Build scripts refactoring

`.github/build-and-upload.sh` to use `build.sh`
Related to  #32

* Update build.sh

Following review comments
هذا الالتزام موجود في:
zstadler
2023-01-12 11:24:39 +02:00
ملتزم من قبل GitHub
الأصل 7b50d771d5
التزام f06f2beb48
2 ملفات معدلة مع 31 إضافات و21 حذوفات

22
.github/build-and-upload.sh مباع Normal file → Executable file
عرض الملف

@@ -1,20 +1,12 @@
#!/bin/bash
echo "Cloning graphhopper"
git clone https://github.com/graphhopper/graphhopper.git
echo "Building docker image"
docker build . -t israelhikingmap/graphhopper:latest
docker login --username $DOCKERHUB_USER --password $DOCKERHUB_TOKEN
echo "Publishing docker image"
docker push israelhikingmap/graphhopper:latest
echo "Buidling and pushing israelhikingmap/graphhopper:latest"
./build.sh --push
TAG=`cd graphhopper; git for-each-ref --sort=committerdate refs/tags | tail -n 1 | cut -d "/" -f3`
if docker manifest inspect israelhikingmap/graphhopper:$TAG >/dev/null; then
echo "No need to publish existing version: $TAG";
TAG=`cd graphhopper; git for-each-ref --sort=committerdate refs/tags | sed -n '$s/.*\///p'`
if docker manifest inspect "israelhikingmap/graphhopper:${TAG}" >/dev/null; then
echo "No need to push existing version: ${TAG}";
else
(cd graphhopper ; git checkout tags/$TAG)
echo "Building docker image for tag: $TAG"
docker build . -t israelhikingmap/graphhopper:$TAG
echo "Publishing docker image for tag: $TAG"
docker push israelhikingmap/graphhopper:$TAG
echo "Buidling and pushing israelhikingmap/graphhopper:${TAG}"
./build.sh --push "${TAG}"
fi