Allow local image build
- Remove dependency on github download - Add `github/build.sh` for local builds - Simplify gtaphhopper build - Simplify handling of `graphhopper.sh` and `config-example.yml`
هذا الالتزام موجود في:
15
.github/build-and-upload.sh
مباع
15
.github/build-and-upload.sh
مباع
@@ -2,30 +2,19 @@
|
|||||||
|
|
||||||
echo "Cloning graphhopper"
|
echo "Cloning graphhopper"
|
||||||
git clone https://github.com/graphhopper/graphhopper.git
|
git clone https://github.com/graphhopper/graphhopper.git
|
||||||
cd graphhopper
|
|
||||||
echo "Downloading Dockerfile and graphhopper.sh"
|
|
||||||
curl -L https://raw.githubusercontent.com/IsraelHikingMap/graphhopper-docker-image-push/main/Dockerfile > Dockerfile
|
|
||||||
curl -L https://raw.githubusercontent.com/IsraelHikingMap/graphhopper-docker-image-push/main/graphhopper.sh > graphhopper.sh
|
|
||||||
chmod +x ./graphhopper.sh
|
|
||||||
echo "Building docker image"
|
echo "Building docker image"
|
||||||
docker build . -t israelhikingmap/graphhopper:latest
|
docker build . -t israelhikingmap/graphhopper:latest
|
||||||
docker login --username $DOCKERHUB_USER --password $DOCKERHUB_TOKEN
|
docker login --username $DOCKERHUB_USER --password $DOCKERHUB_TOKEN
|
||||||
echo "Publishing docker image"
|
echo "Publishing docker image"
|
||||||
docker push israelhikingmap/graphhopper:latest
|
docker push israelhikingmap/graphhopper:latest
|
||||||
|
|
||||||
TAG=`git for-each-ref --sort=committerdate refs/tags | tail -n 1 | cut -d "/" -f3`
|
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
|
if docker manifest inspect israelhikingmap/graphhopper:$TAG >/dev/null; then
|
||||||
echo "No need to publish existing version: $TAG";
|
echo "No need to publish existing version: $TAG";
|
||||||
else
|
else
|
||||||
mv Dockerfile ../Dockerfile
|
(cd graphhopper ; git checkout tags/$TAG)
|
||||||
mv graphhopper.sh ../graphhopper.sh
|
|
||||||
git checkout tags/$TAG
|
|
||||||
mv ../Dockerfile Dockerfile
|
|
||||||
mv ../graphhopper.sh graphhopper.sh
|
|
||||||
echo "Building docker image for tag: $TAG"
|
echo "Building docker image for tag: $TAG"
|
||||||
docker build . -t israelhikingmap/graphhopper:$TAG
|
docker build . -t israelhikingmap/graphhopper:$TAG
|
||||||
echo "Publishing docker image for tag: $TAG"
|
echo "Publishing docker image for tag: $TAG"
|
||||||
docker push israelhikingmap/graphhopper:$TAG
|
docker push israelhikingmap/graphhopper:$TAG
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
6
.github/build.sh
مباع
Normal file
6
.github/build.sh
مباع
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Cloning graphhopper"
|
||||||
|
git clone https://github.com/graphhopper/graphhopper.git
|
||||||
|
echo "Building docker image"
|
||||||
|
docker build . -t israelhikingmap/graphhopper:latest
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
FROM maven:3.6.3-jdk-8 as build
|
FROM maven:3.6.3-jdk-8 as build
|
||||||
|
|
||||||
RUN apt-get install -y wget
|
|
||||||
|
|
||||||
WORKDIR /graphhopper
|
WORKDIR /graphhopper
|
||||||
|
|
||||||
COPY . .
|
COPY graphhopper .
|
||||||
|
|
||||||
RUN mvn clean install
|
RUN mvn clean install
|
||||||
|
|
||||||
@@ -16,9 +14,9 @@ RUN mkdir -p /data
|
|||||||
|
|
||||||
WORKDIR /graphhopper
|
WORKDIR /graphhopper
|
||||||
|
|
||||||
COPY --from=build /graphhopper/web/target/graphhopper*.jar ./
|
COPY --from=build /graphhopper/web/target/graphhopper*.jar .
|
||||||
|
|
||||||
COPY ./config-example.yml ./
|
COPY graphhopper.sh graphhopper/config-example.yml .
|
||||||
|
|
||||||
COPY ./graphhopper.sh ./
|
COPY ./graphhopper.sh ./
|
||||||
|
|
||||||
|
|||||||
@@ -32,3 +32,5 @@ docker run --entrypoint /bin/bash israelhikingmap/graphhopper -c "wget https://d
|
|||||||
```
|
```
|
||||||
|
|
||||||
Checkout `graphhopper.sh` for more usage options such as import.
|
Checkout `graphhopper.sh` for more usage options such as import.
|
||||||
|
|
||||||
|
In order to build the docker image locally, please run [`.github/build.sh`](.github/build.sh).
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم