Skip to content

Commit

Permalink
custom PROJECT_ID; container names with underscores
Browse files Browse the repository at this point in the history
container names end up with underscores and a number as "_1" in my setup. See kartoza#67

In my setting (ubuntu 16.04), compared with the container names in this Makefile, mine have _1 at the end, such as:

dockerosm_db_1
dockerosm_imposm_1
dockerosm_osmupdate_1
  • Loading branch information
mayeulk authored Aug 14, 2018
1 parent b1a7800 commit fa03524
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT_ID := dockerosm
PROJECT_ID := docker-osm-20180622
COMPOSE_FILE := docker-compose.yml
# Uncomment the next line if you want to display data with Leaflet.
# COMPOSE_FILE := docker-compose-web.yml
Expand Down Expand Up @@ -91,14 +91,14 @@ import_clip:
@echo "------------------------------------------------------------------"
@echo "Importing clip shapefile"
@echo "------------------------------------------------------------------"
@docker exec -t -i $(PROJECT_ID)_db /usr/bin/shp2pgsql -c -I -D -s 4326 /home/settings/clip/clip.shp | docker exec -i $(PROJECT_ID)_db su - postgres -c "psql gis"
@docker exec -t -i $(PROJECT_ID)_db_1 /usr/bin/shp2pgsql -c -I -D -s 4326 /home/settings/clip/clip.shp | docker exec -i $(PROJECT_ID)_db su - postgres -c "psql gis"

remove_clip:
@echo
@echo "------------------------------------------------------------------"
@echo "Removing clip shapefile"
@echo "------------------------------------------------------------------"
@docker exec -t -i $(PROJECT_ID)_db /bin/su - postgres -c "psql gis -c 'DROP TABLE IF EXISTS clip;'"
@docker exec -t -i $(PROJECT_ID)_db_1 /bin/su - postgres -c "psql gis -c 'DROP TABLE IF EXISTS clip;'"

###
# STATS
Expand All @@ -110,7 +110,7 @@ timestamp:
@echo "------------------------------------------------------------------"
@echo "Timestamp"
@echo "------------------------------------------------------------------"
@docker exec -t -i $(PROJECT_ID)_imposm cat /home/settings/timestamp.txt
@docker exec -t -i $(PROJECT_ID)_imposm_1 cat /home/settings/timestamp.txt

###
# STYLES
Expand All @@ -122,19 +122,19 @@ import_styles: remove_styles
@echo "------------------------------------------------------------------"
@echo "Importing QGIS styles"
@echo "------------------------------------------------------------------"
@docker exec -i $(PROJECT_ID)_db su - postgres -c "psql -f /home/settings/qgis_style.sql gis"
@docker exec -i $(PROJECT_ID)_db_1 su - postgres -c "psql -f /home/settings/qgis_style.sql gis"

remove_styles:
@echo
@echo "------------------------------------------------------------------"
@echo "Removing QGIS styles"
@echo "------------------------------------------------------------------"
@docker exec -t -i $(PROJECT_ID)_db /bin/su - postgres -c "psql gis -c 'DROP TABLE IF EXISTS layer_styles;'"
@docker exec -t -i $(PROJECT_ID)_db_1 /bin/su - postgres -c "psql gis -c 'DROP TABLE IF EXISTS layer_styles;'"

backup_styles:
@echo
@echo "------------------------------------------------------------------"
@echo "Backup QGIS styles to BACKUP.sql"
@echo "------------------------------------------------------------------"
@echo "SET XML OPTION DOCUMENT;" > BACKUP-STYLES.sql
@ docker exec -t $(PROJECT_ID)_db su - postgres -c "/usr/bin/pg_dump --format plain --inserts --table public.layer_styles gis" >> BACKUP-STYLES.sql
@ docker exec -t $(PROJECT_ID)_db_1 su - postgres -c "/usr/bin/pg_dump --format plain --inserts --table public.layer_styles gis" >> BACKUP-STYLES.sql

0 comments on commit fa03524

Please sign in to comment.