-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
56 lines (41 loc) · 1.26 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
.PHONY: all dev note
dev:
@mix phx.server
release:
@fly deploy
# https://hexdocs.pm/phoenix_analytics/readme.html#installation
init_analytics:
@iex -S mix PhoenixAnalytics.Migration.up()
clean:
@mix clean
@rm analytics.db
@rm analytics.db.wal
prod:
@MIX_ENV=prod mix phx.server
seed:
@mix run priv/repo/seeds.exs
reset_db:
@mix ecto.reset
test:
@mix test
test.watch:
@mix test.watch
# ops commands for prod. should be automated.
# some of this toruble is due to db lock conflicts with duckdb
prod_seed:
fly ssh console -C "\
/app/bin/pling eval 'Application.ensure_all_started(:pling)' && \
/app/bin/pling eval 'Code.eval_file(\"/app/lib/pling-0.1.0/priv/repo/seeds.exs\")'"
prod_migrate:
fly ssh console -C "\
/app/bin/pling eval 'Application.load(:pling)' && \
/app/bin/pling eval 'Pling.Release.migrate()'"
prod_reset:
fly ssh console -C "\
rm -f /data/pling.db* && \
/app/bin/pling eval 'Pling.Release.migrate()' && \
/app/bin/pling eval 'Application.load(:pling)' && \
/app/bin/pling eval 'Application.put_env(:pling, :server, true)' && \
/app/bin/pling eval 'Application.ensure_all_started(:pling)' && \
/app/bin/pling eval ':timer.sleep(2000)' && \
/app/bin/pling eval 'Code.eval_file(\"/app/lib/pling-0.1.0/priv/repo/seeds.exs\")'"