Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #59 from nerves-project/distillery
Distillery support
- Loading branch information
Showing
6 changed files
with
80 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
defmodule Mix.Tasks.Nerves.Release.Init do | ||
use Mix.Task | ||
|
||
@moduledoc """ | ||
Prepares a new project for use with releases. | ||
By default, this forwards the call to | ||
mix release.init --template /path/to/nerves/release_template.eex | ||
For more information on additional args, reference | ||
mix help release.init | ||
""" | ||
|
||
@spec run(OptionParser.argv) :: no_return | ||
def run(args) do | ||
template_path = Path.join(["#{:code.priv_dir(:nerves)}", "templates", "release.eex"]) | ||
Mix.Task.run("release.init", args ++ ["--template", template_path]) | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
%{"bbmustache": {:hex, :bbmustache, "1.0.4", "7ba94f971c5afd7b6617918a4bb74705e36cab36eb84b19b6a1b7ee06427aa38", [], []}, | ||
"cf": {:hex, :cf, "0.2.1", "69d0b1349fd4d7d4dc55b7f407d29d7a840bf9a1ef5af529f1ebe0ce153fc2ab", [], []}, | ||
%{"distillery": {:hex, :distillery, "1.0.0", "a866a72bf2a3a5f078f5a249017ed951acda88a760d200512f91f585d74db1ec", [:mix], []}, | ||
"earmark": {:hex, :earmark, "1.0.3", "89bdbaf2aca8bbb5c97d8b3b55c5dd0cff517ecc78d417e87f1d0982e514557b", [:mix], []}, | ||
"erlware_commons": {:hex, :erlware_commons, "0.21.0", "a04433071ad7d112edefc75ac77719dd3e6753e697ac09428fc83d7564b80b15", [], [{:cf, "0.2.1", [hex: :cf, optional: false]}]}, | ||
"ex_doc": {:hex, :ex_doc, "0.14.3", "e61cec6cf9731d7d23d254266ab06ac1decbb7651c3d1568402ec535d387b6f7", [], [{:earmark, "~> 1.0", [hex: :earmark, optional: false]}]}, | ||
"exrm": {:hex, :exrm, "1.0.8", "5aa8990cdfe300282828b02cefdc339e235f7916388ce99f9a1f926a9271a45d", [:mix], [{:relx, "~> 3.5", [hex: :relx, optional: false]}]}, | ||
"getopt": {:hex, :getopt, "0.8.2", "b17556db683000ba50370b16c0619df1337e7af7ecbf7d64fbf8d1d6bce3109b", [], []}, | ||
"porcelain": {:hex, :porcelain, "2.0.1", "9c3db2b47d8cf6879c0d9ac79db8657333974a88faff09e856569e00c1b5e119", [:mix], []}, | ||
"providers": {:hex, :providers, "1.6.0", "db0e2f9043ae60c0155205fcd238d68516331d0e5146155e33d1e79dc452964a", [], [{:getopt, "0.8.2", [hex: :getopt, optional: false]}]}, | ||
"relx": {:hex, :relx, "3.21.1", "f989dc520730efd9075e9f4debcb8ba1d7d1e86b018b0bcf45a2eb80270b4ad6", [:rebar3], [{:bbmustache, "1.0.4", [hex: :bbmustache, optional: false]}, {:cf, "0.2.1", [hex: :cf, optional: false]}, {:erlware_commons, "0.21.0", [hex: :erlware_commons, optional: false]}, {:getopt, "0.8.2", [hex: :getopt, optional: false]}, {:providers, "1.6.0", [hex: :providers, optional: false]}]}} | ||
"ex_doc": {:hex, :ex_doc, "0.14.5", "c0433c8117e948404d93ca69411dd575ec6be39b47802e81ca8d91017a0cf83c", [:mix], [{:earmark, "~> 1.0", [hex: :earmark, optional: false]}]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
use Mix.Releases.Config, | ||
# This sets the default release built by `mix release` | ||
default_release: :default, | ||
# This sets the default environment used by `mix release` | ||
default_environment: :dev | ||
<%= unless no_docs do %> | ||
# For a full list of config options for both releases | ||
# and environments, visit https://hexdocs.pm/distillery/configuration.html | ||
<% end %> | ||
<%= unless no_docs do %> | ||
# You may define one or more environments in this file, | ||
# an environment's settings will override those of a release | ||
# when building in that environment, this combination of release | ||
# and environment configuration is called a profile | ||
<% end %> | ||
environment :dev do | ||
set cookie: <%= inspect(cookie) %> | ||
end | ||
|
||
environment :prod do | ||
set cookie: <%= inspect(cookie) %> | ||
end | ||
<%= unless no_docs do %> | ||
# You may define one or more releases in this file. | ||
# If you have not set a default release, or selected one | ||
# when running `mix release`, the first release in the file | ||
# will be used by default<% end %> | ||
<%= for release <- releases do %><%= if Keyword.get(release, :is_umbrella) do %> | ||
release :<%= Keyword.get(release, :release_name) %> do | ||
set version: "0.1.0" | ||
set applications: [ | ||
<%= Enum.map(Keyword.get(release, :release_applications), fn {app, start_type} -> | ||
" #{app}: :#{start_type}" | ||
end) |> Enum.join(",\n") %> | ||
] | ||
if System.get_env("NERVES_SYSTEM") do | ||
set dev_mode: false | ||
set include_src: false | ||
set include_erts: System.get_env("ERL_LIB_DIR") | ||
set include_system_libs: System.get_env("ERL_SYSTEM_LIB_DIR") | ||
set vm_args: "rel/vm.args" | ||
end | ||
end<% else %> | ||
release :<%= Keyword.get(release, :release_name) %> do | ||
set version: current_version(:<%= Keyword.get(release, :release_name)%>) | ||
if System.get_env("NERVES_SYSTEM") do | ||
set dev_mode: false | ||
set include_src: false | ||
set include_erts: System.get_env("ERL_LIB_DIR") | ||
set include_system_libs: System.get_env("ERL_SYSTEM_LIB_DIR") | ||
set vm_args: "rel/vm.args" | ||
end | ||
end<% end %> | ||
<% end %> |