Skip to content

Commit

Permalink
iunno
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-does-weather committed Nov 7, 2024
1 parent 5e34949 commit c93fe5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/load-spatial-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ LOCAL_PORT=$(netstat -aln | awk '
trap "exit" SIGINT SIGTERM
trap "kill 0" EXIT

docker compose build spatial

# Get database service connection details from cf
cf curl "/v2/apps/$(cf app --guid "$TARGET")/env" | jq -r '.system_env_json.VCAP_SERVICES["aws-rds"][0].credentials' | jq -r '[.host, .port, .db_name, .username, .password]|@tsv' |
while read -r host port db username password; do
echo "setting up SSH tunnel..."
# open a tunnel
cf ssh -N -T -L "$LOCAL_PORT":"$host":"$port" "$TARGET" &
sleep 15
sleep 5

# load
docker compose run --rm -T spatial node load-shapefiles.js "$username" "$password" "$db" host.docker.internal "$LOCAL_PORT"
Expand Down

0 comments on commit c93fe5c

Please sign in to comment.