-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.old.backup
88 lines (58 loc) · 1.62 KB
/
Makefile.old.backup
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# https://stackoverflow.com/a/14061796/2237879
#
# This hack allows you to run make commands with any set of arguments.
#
# For example, these lines are the same:
# > make g devise:install
# > bundle exec rails generate devise:install
# And these:
# > make add-migration add_deleted_at_to_users deleted_at:datetime
# > bundle exec rails g migration add_deleted_at_to_users deleted_at:datetime
# And these:
# > make add-model Order user:references record:references{polymorphic}
# > bundle exec rails g model Order user:references record:references{polymorphic}
#
RUN_ARGS := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))
add-migration:
bundle exec rails g migration $(RUN_ARGS)
add-model:
bundle exec rails g model $(RUN_ARGS)
db-create:
bundle exec rake db:create
db-migrate:
bundle exec rake db:migrate
db-rollback:
bundle exec rake db:rollback
lint-ruby-setup:
bundle exec rubocop --auto-gen-config
lint-ruby:
bundle exec rubocop -a
lint-security:
brakeman
run-console:
bundle exec rails console
run-generate:
bundle exec rails generate $(RUN_ARGS)
run-rails:
bundle exec puma -t 1:1 -b tcp://0.0.0.0:3000
run-sidekiq:
bundle exec sidekiq -q critical,9 -q default,5 -q low,1
c: run-console
g: run-generate
s: run-rails
# docker
docker:
@docker-compose build
@docker-compose up -d
@docker-compose exec app bundle exec rails db:setup
start:
@docker-compose start
clean:
@docker-compose down
@docker system prune --volumes --force
@rm -rf tmp/* || sudo rm -rf tmp/*
@mkdir -p tmp/pids && touch tmp/pids/.keep
bash:
@docker-compose exec app bash
logs:
@docker-compose logs -f --tail=0 app