-
Notifications
You must be signed in to change notification settings - Fork 99
/
Copy pathmix.exs
97 lines (89 loc) · 2.75 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
defmodule Neko.Mixfile do
use Mix.Project
def project do
[
app: :neko,
version: "0.2.0",
elixir: "~> 1.6",
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
deps: deps(),
aliases: aliases(),
elixirc_paths: elixirc_paths(Mix.env())
]
end
# Configuration for the OTP application
#
# Type "mix help compile.app" for more information
def application do
# dependencies are added to `applications` by default -
# specify only extra applications from Erlang/Elixir
#
# appsignal must be started before application
# (extra_applications are started before applications)
[
# extra_applications: [:logger, :appsignal],
extra_applications: [:logger],
mod: {Neko.Application, []}
]
end
# Dependencies can be Hex packages:
#
# {:my_dep, "~> 0.3.0"}
#
# Or git/path repositories:
#
# {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
#
# Type "mix help deps" for more examples and options
defp deps do
[
{:plug_cowboy, "~> 1.0"},
{:exconstructor, "~> 1.0"},
{:poison, "~> 4.0"},
{:httpoison, "~> 1.0"},
{:edeliver, "~> 1.4"},
# https://github.com/bitwalker/distillery/pull/718#issuecomment-660108166
# start_erl.data fix was merged into master in 2020 ago but there were no releases since that time
{
:distillery,
github: "bitwalker/distillery",
branch: "master",
override: true
},
{:mox, "~> 0.4", only: :test},
# other yaml parsers don't support merging maps
# (except for Yomel but it fails to start in production)
#
# in my fork I just cherry-picked commit with Makefile and
# new rebar.config from master into mapping_as_map branch
# (without Makefile compiled libyaml.so library is not placed into
# _build/<env>/lib/yamler/priv/ and consequently not found both in
# production and on CircleCI)
{
:yamler,
github: "morr/yamler",
branch: "mapping_as_map"
},
# {:appsignal, "~> 1.0"},
{:poolboy, "~> 1.5"},
{:credo, "~> 0.9", only: [:dev, :test], runtime: false}
]
end
defp aliases do
[
"deps.install": ["deps.clean --unused --unlock", "deps.get"],
test: "test --no-start",
deploy: &deploy/1
]
end
defp deploy(_) do
Mix.Task.run(:edeliver, ["update", "production"])
Mix.shell().info("[neko updated]")
Mix.Task.run(:cmd, ["ssh [email protected] sudo systemctl restart neko"])
Mix.shell().info("[neko restarted]")
# Mix.Task.rerun(:edeliver, ["ping", "production"])
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
end