-
Notifications
You must be signed in to change notification settings - Fork 15
/
mix.exs
245 lines (233 loc) · 7.57 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
defmodule Trento.MixProject do
use Mix.Project
@source_url "https://github.com/trento-project/web"
@version "2.3.2"
def project do
[
app: :trento,
description: "Easing your life in administering SAP applications",
version: get_version(),
elixir: "~> 1.15",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
name: "Trento Web",
docs: docs(),
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
coveralls: :test,
"coveralls.github": :test
],
dialyzer: [
plt_add_apps: [:ex_unit, :mix]
# check_plt: true,
# ignore_warnings: "dialyzer_ignore.exs"
]
]
end
# Configuration for the OTP application.
#
# Type `mix help compile.app` for more information.
def application do
[
mod: {Trento.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(_), do: ["lib"]
# Specifies your project dependencies.
#
# Type `mix help deps` for examples and options.
defp deps do
[
{:commanded, "~> 1.4"},
{:commanded_ecto_projections, "~> 1.3"},
{:commanded_eventstore_adapter, "~> 1.4"},
{:cloak, "~> 1.1.2"},
{:cloak_ecto, "~> 1.2.0"},
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:ecto_sql, "~> 3.11"},
{:esbuild, "~> 0.2", runtime: Mix.env() == :dev},
{:eventstore, "~> 1.1",
[env: :prod, git: "https://github.com/commanded/eventstore.git", override: true]},
# {:eventstore_dashboard, github: "commanded/eventstore-dashboard"},
{:ex_doc, "~> 0.29", only: [:dev, :test], runtime: false},
{:ex_machina, "~> 2.7.0", only: :test},
{:excoveralls, "~> 0.10", only: :test},
{:faker, "~> 0.17", only: [:dev, :test]},
{:flop, "~> 0.25.0"},
{:floki, ">= 0.36.2", only: :test},
{:fun_with_flags, "~> 1.8.1"},
{:fun_with_flags_ui, "~> 0.8.0"},
{:gettext, "~> 0.18"},
{:gen_smtp, "~> 1.2.0"},
# project has been archived by its github maintainer
{:gen_rmq, "~> 4.0"},
{:httpoison, "~> 2.0"},
{:jason, "~> 1.2"},
{:junit_formatter, "~> 3.4", only: [:test]},
{:mox, "~> 1.0", only: :test},
{:open_api_spex, "~> 3.19.1"},
{:phoenix, "~> 1.7.14"},
{:phoenix_ecto, "~> 4.5"},
{:phoenix_html, "~> 4.1"},
{:phoenix_live_dashboard, "~> 0.8.4"},
{:phoenix_live_reload, "~> 1.2", only: [:dev, :wanda]},
{:phoenix_live_view, "~> 0.20.17"},
{:phoenix_swoosh, "~> 1.0"},
{:plug_cowboy, "~> 2.5"},
{:postgrex, ">= 0.0.0"},
{:pow, "~> 1.0.38"},
{:quantum, ">= 1.8.0"},
{:swoosh, "~> 1.3"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"},
{:timex, "~> 3.7.7"},
{:trento_contracts,
github: "trento-project/contracts",
ref: "95ed2147fa9d2dafe79139013d5a43d26f92049b",
sparse: "elixir"},
{:unplug, "~> 1.0.0"},
{:proper_case, "~> 1.3.1"},
{:polymorphic_embed, "~> 4.1"},
{:joken, "~> 2.5.0"},
# required overrides to upgrade to elixir 1.15.7 and erlang otp 26
# https://stackoverflow.com/questions/76562092/hi-i-had-created-elixir-project-with-phoenix-framework-there-is-yaml-file-when
{:ecto, "~> 3.10", override: true},
# https://github.com/deadtrickster/ssl_verify_fun.erl/pull/27
{:ssl_verify_fun, "~> 1.1", manager: :rebar3, override: true},
{:parallel_stream, "~> 1.1.0"},
{:x509, "~> 0.8.8"},
{:argon2_elixir, "~> 4.0"},
{:ecto_commons, "~> 0.3.4"},
{:bodyguard, "~> 2.4"},
{:nimble_totp, "~> 1.0"},
{:phoenix_view, "~> 2.0"},
{:phoenix_html_helpers, "~> 1.0"},
{:pow_assent, "~> 0.4.18"},
{:samly, "~> 1.0"}
]
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
[
start: [
"cmd docker-compose up -d",
"deps.get",
"ecto.create",
"ecto.migrate",
"event_store.setup",
"phx.server"
],
setup: ["deps.get", "event_store.setup", "ecto.setup"],
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
"event_store.setup": ["event_store.create", "event_store.init"],
"event_store.reset": ["event_store.drop", "event_store.setup"],
test: [
"ecto.create --quiet",
"ecto.migrate --quiet",
"event_store.create --quiet",
"event_store.init --quiet",
"test"
],
"coveralls.github": [
"ecto.create --quiet",
"ecto.migrate --quiet",
"event_store.create --quiet",
"event_store.init --quiet",
"coveralls.github"
],
"assets.deploy": [
"cmd --cd assets npm run tailwind:build",
"cmd --cd assets npm run build",
"phx.digest"
]
]
end
defp docs do
[
main: "readme",
logo: "priv/static/images/trento.svg",
extra_section: "GUIDES",
source_url: @source_url,
assets: "guides/assets/",
extras: extras(),
groups_for_extras: groups_for_extras(),
groups_for_modules: [
Clusters: [~r/Trento.Clusters.*/],
Hosts: [~r/Trento.Hosts.*/],
SapSystems: [~r/Trento.SapSystems.*/],
Discovery: [~r/Trento.Discovery.*/],
Enums: [~r/Trento.Enums.*/],
Services: [~r/Trento.Services.*/],
"Event handlers": [~r/Trento.*EventHandler$/],
Infrastructure: [~r/Trento.Infrastructure.*/],
Support: [~r/Trento.Support.*/],
Web: [~r/TrentoWeb.*/],
"Legacy events": [~r/Trento.Domain.Events.*/]
],
nest_modules_by_prefix: [
Trento.Clusters,
Trento.Clusters.Commands,
Trento.Clusters.Enums,
Trento.Clusters.Events,
Trento.Clusters.Projections,
Trento.Clusters.ValueObjects,
Trento.Hosts,
Trento.Hosts.Commands,
Trento.Hosts.Events,
Trento.Hosts.Projections,
Trento.Hosts.ValueObjects,
Trento.SapSystems,
Trento.SapSystems.Commands,
Trento.SapSystems.Enums,
Trento.SapSystems.Events,
Trento.SapSystems.Projections,
Trento.SapSystems.Services,
Trento.Infrastructure.Checks,
Trento.Discovery.Payloads,
Trento.Discovery.Policies,
Trento.Domain.Events
]
]
end
def extras() do
[
"README.md",
"CHANGELOG.md",
"CONTRIBUTING.md",
"guides/monitoring/monitoring.md",
"guides/alerting/alerting.md",
"guides/development/environment_variables.md",
"guides/development/hack_on_the_trento.md"
] ++ Path.wildcard("guides/authentication/*.md")
end
defp groups_for_extras do
[
Development: [~r/guides\/development\/.?/, "CONTRIBUTING.md"],
Authentication: [~r/guides\/authentication\/.?/]
]
end
defp get_version, do: System.get_env("VERSION", get_version_from_git())
defp get_version_from_git do
case File.cwd!() |> Path.join("hack/get_version_from_git.sh") |> System.cmd([]) do
{version, 0} -> version |> String.trim("\n")
_ -> @version
end
end
end