forked from ChicagoWorldcon/wellington
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
106 lines (85 loc) · 3.25 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright 2019 James Polley
# Copyright 2019 Steven C Hartley
# Copyright 2019 AJ Esler
# Copyright 2020 Matthew B. Gray
#
# Licensed under the Apache License, Version 2.0 (the "License");
# default target - starts daemons and get running
start: start-support-daemons
bundle exec rails server
# starts daemon then tails logs
start-support-daemons: stop-support-daemons
echo "Mailcatcher starting on http://localhost:1080"
docker-compose up -d # Create and start containers
# rake dev:bootstrap
stop-support-daemons:
docker-compose stop
# stops application containers
stop: stop-daemon stop-support-daemons
echo "Stopped all services"
# stops and removes all docker assets used by this application
clean: stop
docker-compose down --volumes --rmi all # Stop and remove containers, networks, images, and volumes
# stops and removes assets built for the application, leaves base images intact
reset: stop
docker-compose down --volumes --rmi local
docker-compose up -d
rake dev:bootstrap
# tails logs of running application
logs:
docker-compose logs -f # Tail logs
# opens up a REPL that lets you run code in the project
console:
bundle exec rails console
# open a databaes console so you can run SQL queries
# e.g. SELECT * FROM users;
sql:
docker-compose exec postgres psql -U postgres worldcon_development
# Tests only specs introduced on your current branch
test_changes:
git diff origin/master... --name-only | grep '_spec' | ls | bundle exec rspec
# Tests your setup, similar to CI
test:
bundle exec rspec
rubocop
rake test:branch:copyright
bundle update brakeman --quiet
bundle exec brakeman --run-all-checks --no-pager
bundle audit check --update
bundle exec ruby-audit check
# builds, configures and starts application in the background using tmux
daemon: start-support-daemons
script/start-server-in-tmux.sh
echo "Webserver starting on http://localhost:3000"
echo "Mailcatcher starting on http://localhost:1080"
stop-daemon:
script/stop-server-in-tmux.sh
sidekiq:
bundle exec sidekiq -q mailers -q default
# Workflows speicifc to conzealand
# Gives you a full environment, seeded database
# Reset database by setting NAPALM=true in your .env
dc-start: dc-stop
docker-compose -f docker-compose-with-rails.yml up # Create and start containers
# stops application containers
dc-stop:
docker-compose -f docker-compose-with-rails.yml stop
# stops and removes all docker assets used by this application
dc-clean: dc-stop
docker-compose -f docker-compose-with-rails.yml down --volumes --rmi all # Stop and remove containers, networks, images, and volumes
# opens up a REPL that lets you run code in the project
dc-console:
docker-compose -f docker-compose-with-rails.yml exec web bundle exec rails console
# open a databaes console so you can run SQL queries
# e.g. SELECT * FROM users;
dc-sql:
docker-compose -f docker-compose-with-rails.yml exec postgres psql -U postgres worldcon_development
# lets you cd around and have a look at the project
dc-bash:
docker-compose -f docker-compose-with-rails.yml exec web sh
#run Adminer on port 8080 to allow direct DB access.
adminer:
docker run -p 8080:8080 -d adminer
@echo ""
@echo "access adminer on http://localhost:8080"
@echo "database server will be on host.docker.internal:35432 if using default postgres/docner dev config"