-
Notifications
You must be signed in to change notification settings - Fork 1
/
mix.exs
178 lines (155 loc) · 4.73 KB
/
mix.exs
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
defmodule SecretSanta.MixProject do
use Mix.Project
def project do
[
app: :secret_santa,
version: version(),
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
releases: releases(),
]
end
# Configuration for the OTP application.
#
# Type `mix help compile.app` for more information.
def application do
[
mod: {SecretSanta.Application, []},
extra_applications: [:logger, :runtime_tools],
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(:dev), do: ["lib", "priv/repo/seeds"]
defp elixirc_paths(_), do: ["lib"]
defp version() do
[
read_version_file(),
resolve_git_sha_env(),
]
|> Stream.reject(&(is_nil(&1) or &1 == ""))
|> Enum.join("-")
end
defp releases() do
[
secret_santa: [
version: version(),
applications: [secret_santa: :permanent],
include_executables_for: [:unix],
include_erts: true,
strip_beams: true,
quiet: false,
steps: [:assemble, :tar],
],
]
end
defp read_version_file() do
Path.join(__DIR__, "VERSION")
|> File.read!()
|> String.trim()
end
# Specifies your project dependencies.
#
# Type `mix help deps` for examples and options.
defp deps() do
[
# ash
{:ash, "~> 3.4"},
{:ash_authentication, "~> 4.0"},
{:ash_authentication_phoenix, "~> 2.0"},
{:ash_phoenix, "~> 2.0"},
# {:ash_postgres, "~> 2.1"},
{:ash_postgres, github: "ash-project/ash_postgres", branch: "main", override: true},
{:ash_sql, github: "ash-project/ash_sql", branch: "main", override: true},
# cache
{:nebulex, "~> 2.6"},
# certificates
{:castore, "~> 1.0", override: true},
# clustering
{:dns_cluster, "~> 0.1.1"},
# data & formats
{:gettext, "~> 0.20"},
{:jason, "~> 1.2"},
{:nanoid, "~> 2.1"},
{:number, "~> 1.0"},
{:picosat_elixir, "~> 0.2.3"},
# database stuff
{:ecto_sql, "~> 3.10"},
{:phoenix_ecto, "~> 4.4"},
{:postgrex, ">= 0.0.0"},
# decorate
# {:decorator, "~> 1.4"},
# email
{:swoosh, "~> 1.3"},
# http client
{:finch, "~> 0.18"},
# http server
{:bandit, "~> 1.0"},
{:petal_components, "~> 2.4"},
{:phoenix, "~> 1.7.9"},
{:phoenix_html, "~> 4.0"},
{:plug_early_hints, "~> 0.1"},
{:remote_ip, "~> 1.0"},
# liveview
{:phoenix_live_view, "~> 1.0.0-rc.6", override: true},
# oban
{:oban, "~> 2.16"},
# telemetry
{:telemetry, "~> 1.0"},
{:telemetry_metrics, "~> 1.0"},
{:telemetry_poller, "~> 1.0"},
# OpenTelmetry
{:opentelemetry, "~> 1.5"},
{:opentelemetry_api, "~> 1.2"},
{:opentelemetry_bandit, "~> 0.2"},
{:opentelemetry_ecto, "~> 1.2"},
{:opentelemetry_exporter, "~> 1.6"},
{:opentelemetry_phoenix, "~> 2.0"},
{:opentelemetry_semantic_conventions, "~> 1.27"},
{:open_telemetry_decorator, "~> 1.5"},
# tools
{:credo, "~> 1.7", only: :dev},
{:esbuild, "~> 0.7", runtime: Mix.env() == :dev},
{:faker, ">= 0.0.0", only: [:test]},
{:floki, ">= 0.36.2", only: :test},
{:freedom_formatter, ">= 2.0.0", only: :dev},
{:hammox, "~> 0.7.0", only: :test},
{:heroicons,
github: "tailwindlabs/heroicons",
tag: "v2.1.5",
sparse: "optimized",
app: false,
compile: false,
depth: 1},
{:phoenix_live_dashboard, "~> 0.8"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:smokestack, "~> 0.9", only: [:dev, :test]},
{:tailwind, "~> 0.2", runtime: Mix.env() == :dev},
]
end
# Aliases are shortcuts or tasks specific to the current project.
# For example, to install project dependencies and perform other setup tasks, run:
#
# $ mix setup
#
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
seed: ["run priv/repo/seeds.exs"],
setup: ["deps.get", "ecto.setup", "assets.setup", "assets.build"],
"ecto.setup": ["ecto.create", "ecto.migrate"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
"assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"],
"assets.build": ["tailwind default", "esbuild default"],
"assets.deploy": ["tailwind default --minify", "esbuild default --minify", "phx.digest"],
]
end
defp resolve_git_sha_env() do
System.get_env("GIT_VERSION_SHA", "dev")
|> String.trim()
end
end