Sha256: f16f295fd325bf39e7669fcedacf6c54ba7a9cceefbe443949fe0922fbb1ceb2

Contents?: true

Size: 1.1 KB

Versions: 11

Compression:

Stored size: 1.1 KB

Contents

PROJECT ?= <%= get(:dasherized_app_name) %>

SHELL := /bin/bash

run: help

BOLD ?= $(shell tput bold)
NORMAL ?= $(shell tput sgr0)

help:
	@echo "Generate a backup in the environment (staging|production) database:"
	@echo "  ${BOLD}make backup-<environment>${NORMAL}"
	@echo ""
	@echo "Copy latest database backup from the environment (staging|production) to local database:"
	@echo "  ${BOLD}make restore-from-<environment>${NORMAL}"
	@echo ""

services-port:
	@set -o pipefail; \
	docker-compose 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)

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
potassium-7.2.0 lib/potassium/assets/Makefile.erb
potassium-7.1.0 lib/potassium/assets/Makefile.erb
potassium-7.0.0 lib/potassium/assets/Makefile.erb
potassium-6.7.0 lib/potassium/assets/Makefile.erb
potassium-6.6.0 lib/potassium/assets/Makefile.erb
potassium-6.5.0 lib/potassium/assets/Makefile.erb
potassium-6.4.0 lib/potassium/assets/Makefile.erb
potassium-6.3.0 lib/potassium/assets/Makefile.erb
potassium-6.2.0 lib/potassium/assets/Makefile.erb
potassium-6.1.0 lib/potassium/assets/Makefile.erb
potassium-6.0.0 lib/potassium/assets/Makefile.erb