From e003b74705412b95d6608a44c150beb6938b1bf3 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 25 Mar 2024 12:15:47 +0100 Subject: [PATCH 1/5] Upgrade to newest version of OTP --- .otp-version | 1 + build-graph.sh | 6 +++--- infrastructure/docker/otp/Dockerfile | 3 ++- run-otp.sh | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .otp-version diff --git a/.otp-version b/.otp-version new file mode 100644 index 00000000..6fa3a78c --- /dev/null +++ b/.otp-version @@ -0,0 +1 @@ +export OTP_IMAGE="opentripplanner/opentripplanner:2.6.0_2024-03-21T15-09" \ No newline at end of file diff --git a/build-graph.sh b/build-graph.sh index 9e02216b..1b8cbe4f 100755 --- a/build-graph.sh +++ b/build-graph.sh @@ -4,6 +4,8 @@ # # SPDX-License-Identifier: CC0-1.0 +source .otp-version + WGET="wget --progress=bar:force:noscroll" # OSM @@ -14,9 +16,6 @@ SOUTH_TYROL_PBF=data/south-tyrol.osm.pbf ELEVATION_URL=https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF/srtm_39_03.zip ELEVATION_ZIP=data/srtm_39_03.zip -# OTP -OTP_IMAGE=docker.io/opentripplanner/opentripplanner:2.5.0_2024-01-19T14-50 - # when on github actions then install the required tools if [ -n "${CI+isset}" ]; then sudo apt-get -qq install osmium-tool pyosmium wget @@ -32,6 +31,7 @@ else fi # cut out South Tyrol from the large North East Italy extract +echo "Extracting ${SOUTH_TYROL_PBF} from ${NORTH_EAST_PBF}" osmium extract ${NORTH_EAST_PBF} --polygon south-tyrol.geojson -o ${SOUTH_TYROL_PBF} --overwrite if [ ! -f "${ELEVATION_ZIP}" ]; then diff --git a/infrastructure/docker/otp/Dockerfile b/infrastructure/docker/otp/Dockerfile index 861b803a..4801f7d2 100644 --- a/infrastructure/docker/otp/Dockerfile +++ b/infrastructure/docker/otp/Dockerfile @@ -1,4 +1,5 @@ -FROM docker.io/opentripplanner/opentripplanner:2.5.0_2024-01-19T14-50 +# Simon, do you know how we could use the value from .otp-version here? +FROM opentripplanner/opentripplanner:2.6.0_2024-03-21T15-09 WORKDIR /var/otp diff --git a/run-otp.sh b/run-otp.sh index b0c38fa1..ad23e038 100755 --- a/run-otp.sh +++ b/run-otp.sh @@ -1,10 +1,10 @@ -#!/bin/sh +#!/bin/bash -e # SPDX-FileCopyrightText: NOI Techpark # # SPDX-License-Identifier: CC0-1.0 -OTP_IMAGE=docker.io/opentripplanner/opentripplanner:2.5.0_2024-01-19T14-50 +source .otp-version docker run \ -it \ From 41a24e389c30704adfa2b02e83c91e673fe9a2f4 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 25 Mar 2024 12:20:10 +0100 Subject: [PATCH 2/5] Add header --- .otp-version | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.otp-version b/.otp-version index 6fa3a78c..28428843 100644 --- a/.otp-version +++ b/.otp-version @@ -1 +1,4 @@ +# SPDX-FileCopyrightText: NOI Techpark +# +# SPDX-License-Identifier: CC0-1.0 export OTP_IMAGE="opentripplanner/opentripplanner:2.6.0_2024-03-21T15-09" \ No newline at end of file From bce3d278015ec01aeba1b5aa8c6a2b8f7f1769c8 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 25 Mar 2024 12:23:47 +0100 Subject: [PATCH 3/5] Use . instead of source --- build-graph.sh | 2 +- run-otp.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-graph.sh b/build-graph.sh index 1b8cbe4f..ae411651 100755 --- a/build-graph.sh +++ b/build-graph.sh @@ -4,7 +4,7 @@ # # SPDX-License-Identifier: CC0-1.0 -source .otp-version +. .otp-version WGET="wget --progress=bar:force:noscroll" diff --git a/run-otp.sh b/run-otp.sh index ad23e038..85309d4a 100755 --- a/run-otp.sh +++ b/run-otp.sh @@ -4,7 +4,7 @@ # # SPDX-License-Identifier: CC0-1.0 -source .otp-version +. .otp-version docker run \ -it \ From 19a5e7b4a3e350500cf88a134d5713f44eb793f3 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 25 Mar 2024 12:25:26 +0100 Subject: [PATCH 4/5] Only push when repo owner is noi --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1eec918d..e49351b3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -115,7 +115,8 @@ jobs: - name: Build graph run: sh build-graph.sh - - name: Build and push + - name: Build and push + if: github.repository_owner == 'noi-techpark' uses: noi-techpark/github-actions/docker-build-and-push@v2 with: docker-username: ${{ github.actor }} @@ -123,6 +124,7 @@ jobs: docker-compose-file: docker-compose.build.yml - name: Deploy application + if: github.repository_owner == 'noi-techpark' uses: noi-techpark/github-actions/docker-deploy@v2 with: hosts: 'test' From afaed14ae290aed55e80c88aefb8c3308786ee3c Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 25 Mar 2024 12:27:04 +0100 Subject: [PATCH 5/5] Run with bash --- .github/workflows/main.yml | 2 +- build-graph.sh | 2 +- run-otp.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e49351b3..45f3d7ef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,7 +113,7 @@ jobs: key: input-data - name: Build graph - run: sh build-graph.sh + run: bash build-graph.sh - name: Build and push if: github.repository_owner == 'noi-techpark' diff --git a/build-graph.sh b/build-graph.sh index ae411651..1b8cbe4f 100755 --- a/build-graph.sh +++ b/build-graph.sh @@ -4,7 +4,7 @@ # # SPDX-License-Identifier: CC0-1.0 -. .otp-version +source .otp-version WGET="wget --progress=bar:force:noscroll" diff --git a/run-otp.sh b/run-otp.sh index 85309d4a..ad23e038 100755 --- a/run-otp.sh +++ b/run-otp.sh @@ -4,7 +4,7 @@ # # SPDX-License-Identifier: CC0-1.0 -. .otp-version +source .otp-version docker run \ -it \