Sha256: 00aa86b303700f03503c582ee0393fd6a369c1e28802dbc9075029dc05f3d073

Contents?: true

Size: 1.08 KB

Versions: 7

Compression:

Stored size: 1.08 KB

Contents

PROJECT ?= lacatan

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

7 entries across 7 versions & 1 rubygems

Version Path
repo_analyzer-1.6.0 spec/assets/test_project/valid_makefile
repo_analyzer-1.5.0 spec/assets/test_project/valid_makefile
repo_analyzer-1.4.0 spec/assets/test_project/valid_makefile
repo_analyzer-1.3.0 spec/assets/test_project/valid_makefile
repo_analyzer-1.2.0 spec/assets/test_project/valid_makefile
repo_analyzer-1.1.0 spec/assets/test_project/valid_makefile
repo_analyzer-1.0.0 spec/assets/test_project/valid_makefile