@@ -29,3 +29,49 @@ postinstall = """
2929 mix local.hex --force --if-missing
3030 mix local.rebar --force --if-missing
3131"""
32+
33+ [tasks .docker-compose-up ]
34+ description = " Start Docker Compose services, waiting for them to be healthy before exiting"
35+ run = " docker compose up --wait"
36+
37+ [tasks .server ]
38+ description = " Start the Phoenix application with debugging enabled" # https://hexdocs.pm/elixir/debugging.html#pry
39+ depends = [ " docker-compose-up" ]
40+ run = " iex --dbg pry -S mix phx.server"
41+ alias = " s"
42+
43+ [tasks .iex ]
44+ description = " Start an interactive shell with all dependencies"
45+ depends = [ " docker-compose-up" ]
46+ run = " iex -S mix"
47+ alias = " i"
48+
49+ [tasks .format ]
50+ description = " Format Elixir code"
51+ run = " mix format"
52+ alias = " f"
53+
54+ [tasks .test ]
55+ description = " Run tests"
56+ depends = [ " docker-compose-up" ]
57+ run = " mix test"
58+ alias = " t"
59+
60+ [tasks .db-setup ]
61+ description = " Set up the database"
62+ depends = [ " db-create" , " db-migrate" , " db-seed" ]
63+
64+ [tasks .db-create ]
65+ description = " Create the database"
66+ depends = [ " docker-compose-up" ]
67+ run = " mix ecto.create"
68+
69+ [tasks .db-migrate ]
70+ description = " Migrate the database"
71+ depends = [ " docker-compose-up" ]
72+ run = " mix ecto.migrate"
73+
74+ [tasks .db-seed ]
75+ description = " Seed the database"
76+ depends = [ " docker-compose-up" ]
77+ run = " mix run priv/repo/seeds.exs"
0 commit comments