-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (26 loc) · 1.44 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.DEFAULT_GOAL := help
SHELL := /bin/bash
.PHONY: help format test run setup-db seed-test-data generate-manifest deploy-app migrate-db-and-wait-for-success
help: ## Print help documentation
@echo -e "Makefile Help for epb-data-warehouse"
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
format: ## Runs Rubocop with the GOV.UK rules
@bundle exec rubocop --autocorrect
setup-db: ## Creates local development and test databases
@echo ">>>>> Creating DB"
@bundle exec rake db:create DATABASE_URL="postgresql://postgres:${DOCKER_POSTGRES_PASSWORD}@localhost:5432/epb_eav_test"
@bundle exec rake db:create DATABASE_URL="postgresql://postgres:${DOCKER_POSTGRES_PASSWORD}@localhost:5432/epb_eav_development"
@echo ">>>>> Migrating DB"
@bundle exec rake db:migrate DATABASE_URL="postgresql://postgres:${DOCKER_POSTGRES_PASSWORD}@localhost:5432/epb_eav_test"
@bundle exec rake db:migrate DATABASE_URL="postgresql://postgres:${DOCKER_POSTGRES_PASSWORD}@localhost:5432/epb_eav_development"
seed-test-data:
@echo ">>>>> Seeding DB with test data"
@bundle exec rake seed_test_data DATABASE_URL="postgresql://postgres:${DOCKER_POSTGRES_PASSWORD}@localhost:5432/epb_eav_development"
test:
@bundle exec rspec
run:
@bundle exec rake
seed-stats-data:
@bundle exec rake seed_countries
@bundle exec rake seed_average_co2_emissions
@bundle exec rake refresh_average_co2_emissions