lib/potassium/assets/Makefile.erb in potassium-5.2.2 vs lib/potassium/assets/Makefile.erb in potassium-5.2.3
- old
+ new
@@ -42,5 +42,20 @@
docker-compose $(DOCKER_COMPOSE_ARGS) logs -f
services-port:
@set -o pipefail; \
docker-compose $(DOCKER_COMPOSE_ARGS) port ${SERVICE} ${PORT} 2> /dev/null | cut -d':' -f2 || echo ${PORT}
+
+backup-staging: ROLE=staging
+backup-production: ROLE=production
+backup-%:
+ @echo Capturing $(ROLE)....
+ @heroku pg:backups:capture --remote $(ROLE)
+
+restore-from-staging: ROLE=staging
+restore-from-production: ROLE=production
+restore-from-%:
+ $(eval TEMP_FILE=$(shell mktemp))
+ @echo Restoring from $(ROLE)....
+ @heroku pg:backups:download --remote $(ROLE) --output $(TEMP_FILE)
+ @pg_restore --verbose --clean --no-acl --no-owner -h localhost \
+ -U postgres -p $(shell make services-port SERVICE=postgresql PORT=5432) -d $(PROJECT)_development $(TEMP_FILE)