-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmix.exs
More file actions
162 lines (148 loc) · 4.89 KB
/
mix.exs
File metadata and controls
162 lines (148 loc) · 4.89 KB
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
# NOTE: Load shared configuration
Code.require_file("mix/shared.exs")
defmodule Deployex.MixProject do
use Mix.Project
@source_url "https://github.com/thiagoesteves/deployex"
def project do
[
name: "Deployex",
apps_path: "apps",
version: Mix.Shared.version(),
source_url: @source_url,
homepage_url: @source_url,
start_permanent: Mix.env() == :prod,
deps: deps(),
docs: docs(),
test_coverage: Mix.Shared.test_coverage(),
package: package(),
description: description(),
releases: [
deployex: [
include_executable_for: [:unix],
steps: [:assemble, &Jellyfish.generate/1, :tar],
applications: [
foundation: :permanent,
host: :permanent,
deployer: :permanent,
sentinel: :permanent,
deployex_web: :permanent
],
config_providers: [
{Foundation.ConfigProvider.Env.Config, nil},
{Foundation.ConfigProvider.Secrets.Manager, nil}
]
]
],
dialyzer: [
plt_add_apps: [:ex_unit, :mix],
plt_file: {:no_warn, "priv/plts/dialyzer.plt"}
],
aliases: aliases(),
listeners: [Phoenix.CodeReloader]
]
end
defp description do
"""
Deployex is a tool designed for managing deployments for Beam applications (Elixir, Erlang and Gleam)
"""
end
defp package do
[
files: [
"apps",
"mix.exs",
"README.md",
"LICENSE.md",
"CHANGELOG.md",
".formatter.exs"
],
maintainers: ["Thiago Esteves"],
licenses: ["MIT"],
links: %{
Documentation: "https://hexdocs.pm/deployex",
Changelog: "#{@source_url}/blob/main/CHANGELOG.md",
GitHub: @source_url
}
]
end
defp docs do
[
main: "readme",
source_ref: Mix.Shared.version(),
formatters: ["html"],
api_reference: false,
extra_section: ["GUIDES"],
groups_for_extras: groups_for_extras(),
extras: [
"README.md",
"LICENSE.md": [filename: "license", title: "License"],
"CHANGELOG.md": [filename: "changelog", title: "Changelog"],
"guides/docs/aws-elixir/README.md": [filename: "README.md", title: "AWS-Elixir"],
"guides/docs/aws-erlang/README.md": [filename: "README.md", title: "AWS-Erlang"],
"guides/docs/aws-gleam/README.md": [filename: "README.md", title: "AWS-Gleam"],
"guides/docs/gcp-elixir/README.md": [filename: "README.md", title: "GCP-Elixir"],
"guides/docs/local-elixir/README.md": [filename: "README.md", title: "Local-Elixir"],
"guides/docs/local-elixir/README.md": [
filename: "README.md",
title: "Local-Elixir-Ecto"
],
"guides/docs/local-elixir-umbrella/README.md": [
filename: "README.md",
title: "Local-Elixir-Umbrella"
],
"guides/docs/local-erlang/README.md": [filename: "README.md", title: "Local-Erlang"],
"guides/docs/local-gleam/README.md": [filename: "README.md", title: "Local-Gleam"],
"guides/docs/yaml/README.md": [filename: "README.md", title: "YAML"],
"guides/docs/hot-upgrades/README.md": [filename: "README.md", title: "Hot Upgrades"]
]
]
end
defp groups_for_extras do
[
"Installation and Deploy": Path.wildcard("guides/docs/*/*.md")
]
end
# Dependencies listed here are available only for this
# project and cannot be accessed from applications inside
# the apps folder.
#
# Run "mix help deps" for examples and options.
defp deps do
[
{:ex_doc, "~> 0.34", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
{:mock, "~> 0.3.0", only: :test},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:mix_audit, "~> 2.1", only: [:dev, :test], runtime: false},
{:jellyfish, "~> 0.2.0"}
]
end
defp cleanup_doc_config_js(_) do
files = Path.wildcard("./doc/*html")
Enum.each(files, fn file ->
System.cmd("sed", ["-i", ".backup", "/docs_config.js/d", file])
File.rm("#{file}.backup")
end)
end
defp copy_ex_doc_images(_) do
static_destination_path = "./doc/guides/static"
File.mkdir_p!(static_destination_path)
File.cp_r("./guides/static", static_destination_path)
end
defp publish_docs(_) do
docs_folder = "apps/deployex_web/priv/static/docs"
File.cp_r("./doc", docs_folder)
System.cmd("tar", ["czf", "#{docs_folder}/docs.tar.gz", "-C", "./doc", "."])
end
defp digest_docs(_) do
docs_folder = "apps/deployex_web/priv/static/docs"
System.cmd("tar", ["xf", "#{docs_folder}/docs.tar.gz", "-C", docs_folder])
File.rm("#{docs_folder}/docs.tar.gz")
end
defp aliases do
[
docs: ["docs", &cleanup_doc_config_js/1, ©_ex_doc_images/1, &publish_docs/1],
release: [&digest_docs/1, "release"]
]
end
end