From bd3cfaf806979363d9ecaa74c1631bdf3677e377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teemu=20M=C3=A4kinen?= Date: Thu, 7 Mar 2024 14:18:14 +0200 Subject: [PATCH] Read Timetables-API location from env var Use TIMETABLESAPI_HOSTNAME and TIMETABLESAPI_PORT variables to form the location of the Timetables API service Use this location in the actions yaml. --- metadata/generic/actions.yaml | 6 ------ metadata/hsl/actions.yaml | 8 ++++---- scripts/docker-entrypoint.sh | 1 + 3 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 metadata/generic/actions.yaml diff --git a/metadata/generic/actions.yaml b/metadata/generic/actions.yaml deleted file mode 100644 index 1edb4c2f..00000000 --- a/metadata/generic/actions.yaml +++ /dev/null @@ -1,6 +0,0 @@ -actions: [] -custom_types: - enums: [] - input_objects: [] - objects: [] - scalars: [] diff --git a/metadata/hsl/actions.yaml b/metadata/hsl/actions.yaml index 1dc866bf..28315e03 100644 --- a/metadata/hsl/actions.yaml +++ b/metadata/hsl/actions.yaml @@ -2,7 +2,7 @@ actions: - name: combineTimetables definition: kind: synchronous - handler: http://jore4-timetablesapi:8080/timetables/combine + handler: "{{HASURA_TIMETABLESAPI_URL}}/timetables/combine" request_transform: body: action: transform @@ -14,7 +14,7 @@ actions: - name: replaceTimetables definition: kind: synchronous - handler: http://jore4-timetablesapi:8080/timetables/replace + handler: "{{HASURA_TIMETABLESAPI_URL}}/timetables/replace" request_transform: body: action: transform @@ -26,7 +26,7 @@ actions: - name: toCombineTargetVehicleScheduleFrameId definition: kind: "" - handler: http://jore4-timetablesapi:8080/timetables/to-combine + handler: "{{HASURA_TIMETABLESAPI_URL}}/timetables/to-combine" request_transform: method: GET query_params: @@ -41,7 +41,7 @@ actions: - name: toReplaceVehicleScheduleFrameIds definition: kind: "" - handler: http://jore4-timetablesapi:8080/timetables/to-replace + handler: "{{HASURA_TIMETABLESAPI_URL}}/timetables/to-replace" request_transform: method: GET query_params: diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh index 56943038..0aecf772 100755 --- a/scripts/docker-entrypoint.sh +++ b/scripts/docker-entrypoint.sh @@ -20,4 +20,5 @@ HASURA_GRAPHQL_ADMIN_SECRET="$HASURA_ADMIN_SECRET" \ HASURA_GRAPHQL_DATABASE_URL="postgresql://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOSTNAME}:5432/${DB_NAME}" \ HASURA_TIMETABLES_DATABASE_URL="postgresql://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOSTNAME}:5432/${DB_TIMETABLES_NAME}" \ HASURA_TIAMAT_SCHEMA_URL="http://${TIAMAT_HOSTNAME:-jore4-tiamat}:${TIAMAT_PORT:-1888}/services/stop_places/graphql" \ + HASURA_TIMETABLESAPI_URL="http://${TIMETABLESAPI_HOSTNAME:-jore4-timetablesapi}:${TIMETABLESAPI_PORT:-8080}" \ exec /bin/docker-entrypoint.sh "$@"