Skip to content

Commit

Permalink
Switch from distillery to mix releases
Browse files Browse the repository at this point in the history
  • Loading branch information
bgottlob committed Mar 11, 2021
1 parent fde05a9 commit 00c1a5e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 28 deletions.
5 changes: 1 addition & 4 deletions apps/apex/lib/environment.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ defmodule Apex.Node do
end

def connect(name, hostname) do
ip = case Mix.env() == :prod do
true -> look_up_ip(hostname)
_ -> Node.self |> to_string |> String.split("@") |> List.last
end
ip = Node.self |> to_string |> String.split("@") |> List.last
Node.connect(:"#{name}@#{ip}")
end
end
4 changes: 0 additions & 4 deletions apps/apex_dash/config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,3 @@ config :logger, level: :info
#
# config :apex_dash, ApexDashWeb.Endpoint, server: true
#

# Finally import the config/prod.secret.exs
# which should be versioned separately.
import_config "prod.secret.exs"
16 changes: 1 addition & 15 deletions apps/apex_dash/lib/apex_dash/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,7 @@ defmodule ApexDash.Application do
#{ApexDash.PaceConsumer, []}
]

conn = Apex.Node.connect(
:apex_broadcast,
System.get_env("APEX_BROADCAST_HOST")
)

stages = case conn do
true ->
IO.puts "Connected to distributed Apex Broadcast node"
:global.sync()
[{ApexDash.LiveDispatcher, []}]
_ ->
IO.puts "Unable to connect to Apex Broadcast node"
[%{id: Apex.Broadcaster, start: {Apex.Broadcaster, :start_link, [20_777, [name: {:global, ApexBroadcast}]]}},
{ApexDash.LiveDispatcher, []}]
end
stages = [{ApexDash.LiveDispatcher, []}]

# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
Expand Down
2 changes: 1 addition & 1 deletion apps/apex_dash/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule ApexDash.Mixfile do
def application do
[
mod: {ApexDash.Application, []},
extra_applications: [:logger, :runtime_tools]
extra_applications: [:apex_broadcast, :logger, :runtime_tools]
]
end

Expand Down
12 changes: 10 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ defmodule ApexUmbrella.Mixfile do
apps_path: "apps",
version: "0.1.0",
start_permanent: Mix.env() == :prod,
deps: deps()
deps: deps(),
releases: [
dash_only: [
include_executables_for: [:unix],
applications: [
apex_dash: :permanent,
runtime_tools: :permanent
]
]
]
]
end

Expand All @@ -18,7 +27,6 @@ defmodule ApexUmbrella.Mixfile do
defp deps do
[
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
{:distillery, "2.1.1"}
]
end
end
2 changes: 0 additions & 2 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
%{
"artificery": {:hex, :artificery, "0.4.3", "0bc4260f988dcb9dda4b23f9fc3c6c8b99a6220a331534fdf5bf2fd0d4333b02", [:mix], [], "hexpm", "12e95333a30e20884e937abdbefa3e7f5e05609c2ba8cf37b33f000b9ffc0504"},
"bolt_sips": {:hex, :bolt_sips, "2.0.7", "0a1ac7d840afaac00b149f5bf149369ab30b2b775f6822b988c440dec831be4e", [:mix], [{:calendar, "~> 0.17.2", [hex: :calendar, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:poison, "~> 3.1", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm", "e0b480e639a2a63e31da7331efc7338c4a039c1ca85c60a6bdde51fb04e315dc"},
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
"calendar": {:hex, :calendar, "0.17.6", "ec291cb2e4ba499c2e8c0ef5f4ace974e2f9d02ae9e807e711a9b0c7850b9aee", [:mix], [{:tzdata, "~> 0.5.20 or ~> 0.1.201603 or ~> 1.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "738d0e17a93c2ccfe4ddc707bdc8e672e9074c8569498483feb1c4530fb91b2b"},
Expand All @@ -9,7 +8,6 @@
"cowlib": {:hex, :cowlib, "2.9.1", "61a6c7c50cf07fdd24b2f45b89500bb93b6686579b069a89f88cb211e1125c78", [:rebar3], [], "hexpm", "e4175dc240a70d996156160891e1c62238ede1729e45740bdd38064dad476170"},
"credo": {:hex, :credo, "1.5.1", "4fe303cc828412b9d21eed4eab60914c401e71f117f40243266aafb66f30d036", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "0b219ca4dcc89e4e7bc6ae7e6539c313e738e192e10b85275fa1e82b5203ecd7"},
"db_connection": {:hex, :db_connection, "2.3.1", "4c9f3ed1ef37471cbdd2762d6655be11e38193904d9c5c1c9389f1b891a3088e", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm", "abaab61780dde30301d840417890bd9f74131041afd02174cf4e10635b3a63f5"},
"distillery": {:hex, :distillery, "2.1.1", "f9332afc2eec8a1a2b86f22429e068ef35f84a93ea1718265e740d90dd367814", [:mix], [{:artificery, "~> 0.2", [hex: :artificery, repo: "hexpm", optional: false]}], "hexpm", "bbc7008b0161a6f130d8d903b5b3232351fccc9c31a991f8fcbf2a12ace22995"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"gen_stage": {:hex, :gen_stage, "1.0.0", "51c8ae56ff54f9a2a604ca583798c210ad245f415115453b773b621c49776df5", [:mix], [], "hexpm", "1d9fc978db5305ac54e6f5fec7adf80cd893b1000cf78271564c516aa2af7706"},
"gettext": {:hex, :gettext, "0.18.0", "406d6b9e0e3278162c2ae1de0a60270452c553536772167e2d701f028116f870", [:mix], [], "hexpm", "c3f850be6367ebe1a08616c2158affe4a23231c70391050bf359d5f92f66a571"},
Expand Down

0 comments on commit 00c1a5e

Please sign in to comment.