-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
64 lines (48 loc) · 1.39 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Tools
SHELL := /bin/bash
# Default command and help messages
.PHONY: default help
default: help
#!
#! Running the application:
up: ## Launch the entire application
console: ## Launch a Rails console
test: ## Run tests
#!
#! Installation, setup, and maintenance:
setup: ## Create a seed database (WILL DESTROY EXISTING DATA)
migrate: ## Run migrations
bundle: ## Install gems
mysql: ## Connect to mysql server
#!
#! Other:
# See https://gist.github.com/prwhite/8168133
help: ## Show this message
@egrep -h "##|#!" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | sed -e 's/: / /' | sed -e 's/^/ make /' | sed -e 's/^[ ]*make #![ ]*//'
@echo
#!
#! To run the application for the first time, use:
#! $ make setup && make up
# Commands
.PHONY: up
up: bundle migrate
bundle exec foreman start
.PHONY: console
console: bundle migrate
bin/console
.PHONY: test
test: bundle migrate
bundle exec rake test
.PHONY: setup
setup: bundle
bin/setup
.PHONY: migrate
migrate: bundle
cmp -s .last_migrate <(md5 -q <(ls db/migrate)) || \
(bundle exec bin/rake db:migrate && md5 -q <(ls db/migrate) > .last_migrate)
.PHONY: bundle
bundle:
cmp -s .last_bundle_installed <(md5 -q Gemfile Gemfile.lock) || \
(bundle install && md5 -q Gemfile Gemfile.lock > .last_bundle_installed)
# Include any local customizations
-include Makefile.local