Skip to content

Commit

Permalink
GTFS import: allow non-interactive Docker-based import 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Oct 3, 2024
1 parent f717075 commit 42ad436
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ export GTFS_IMPORTER_DB_PREFIX="${GTFS_IMPORTER_DB_PREFIX:-gtfs}"
export GTFS_TMP_DIR="${GTFS_TMP_DIR:-"$PWD/gtfs"}"
export GTFS_POSTPROCESSING_D_PATH="${GTFS_POSTPROCESSING_D_PATH:-"$PWD/gtfs-postprocessing.d"}"

# if stdin is not a TTY, don't pass `-it`
docker_run_args=()
if [ -t 1 ]; then
docker_run_args+=('-it')
fi

set -x

if [ "${1:-}" = '--docker' ]; then
# run PostGIS GTFS importer using Docker
# todo: remove --platform
docker run --rm -it \
docker run --rm "${docker_run_args[@]}" \
--platform linux/amd64 \
--network host \
-v $PWD/gtfs:/tmp/gtfs \
Expand Down

0 comments on commit 42ad436

Please sign in to comment.