diff --git a/.gitignore b/.gitignore index a76453b..9297b96 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ mebe_2-*.tar # Built frontend assets /priv/static + +# Build machinery +.vagrant diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9fdd4e2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "elixir-vagrant-setup"] + path = elixir-vagrant-setup + url = https://gitlab.com/Nicd/elixir-vagrant-setup.git diff --git a/Vagrantfile b/Vagrantfile new file mode 120000 index 0000000..0a2771b --- /dev/null +++ b/Vagrantfile @@ -0,0 +1 @@ +elixir-vagrant-setup/Vagrantfile \ No newline at end of file diff --git a/config/config.exs b/config/config.exs index 8afc183..d79989a 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,6 +1,6 @@ # This file is responsible for configuring your application # and its dependencies with the aid of the Mix.Config module. -use Mix.Config +import Config # This configuration is loaded before any dependency and is restricted # to this project. If another project depends on this project, this diff --git a/elixir-vagrant-setup b/elixir-vagrant-setup new file mode 160000 index 0000000..a46a685 --- /dev/null +++ b/elixir-vagrant-setup @@ -0,0 +1 @@ +Subproject commit a46a6859539ad2be7469edda9bed807963f187c5 diff --git a/mix.exs b/mix.exs index 7093e29..9489a23 100644 --- a/mix.exs +++ b/mix.exs @@ -7,7 +7,15 @@ defmodule Mebe2.MixProject do version: "0.3.0", elixir: "~> 1.10", start_permanent: Mix.env() == :prod, - deps: deps() + deps: deps(), + releases: [ + mebe: [ + steps: [:assemble, :tar], + config_providers: [ + {Config.Reader, {:system, "MEBE_WORKING_DIR", "/config.prod.exs"}} + ] + ] + ] ] end diff --git a/rel/config.exs b/rel/config.exs deleted file mode 100644 index 7121365..0000000 --- a/rel/config.exs +++ /dev/null @@ -1,62 +0,0 @@ -# Import all plugins from `rel/plugins` -# They can then be used by adding `plugin MyPlugin` to -# either an environment, or release definition, where -# `MyPlugin` is the name of the plugin module. -~w(rel plugins *.exs) -|> Path.join() -|> Path.wildcard() -|> Enum.map(&Code.eval_file(&1)) - -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: Mix.env() - -# For a full list of config options for both releases -# and environments, visit https://hexdocs.pm/distillery/config/distillery.html - -# 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 - -environment :dev do - # If you are running Phoenix, you should make sure that - # server: true is set and the code reloader is disabled, - # even in dev mode. - # It is recommended that you build with MIX_ENV=prod and pass - # the --env flag to Distillery explicitly if you want to use - # dev mode. - set(dev_mode: true) - set(include_erts: false) - set(cookie: :"k(2`m4yq3i$1?0<[)TwNJEVE/Qy.KA&3rl=2C}g7d0bCVx93s^7r5Y%_.&:m,%JX") -end - -environment :prod do - set(include_erts: true) - set(include_src: false) - set(cookie: System.get_env("COOKIE") |> String.to_atom()) - set(vm_args: "rel/vm.args") - - set( - config_providers: [ - {Mix.Releases.Config.Providers.Elixir, ["${CONFIG_PATH}/custom-config.exs"]} - ] - ) -end - -# 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 - -release :mebe_2 do - set(version: current_version(:mebe_2)) - - set( - applications: [ - :runtime_tools - ] - ) -end diff --git a/rel/config/config.exs b/rel/config/config.exs deleted file mode 100644 index f0b8b08..0000000 --- a/rel/config/config.exs +++ /dev/null @@ -1,12 +0,0 @@ -use Mix.Config - -# This file is used for configuring the Mebe2 release after release generation time. You can -# override settings that were set during release compilation time using this file by copying the -# settings over and setting a new value for them. - -# Example: -# config :mebe_2, -# data_path: "/foo/bar" - -# Note: Some settings can be also configured by using environment variables. The values from env -# vars will overwrite the values set here. diff --git a/rel/plugins/.gitignore b/rel/plugins/.gitignore deleted file mode 100644 index 4fa3b5c..0000000 --- a/rel/plugins/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.* -!*.exs -!.gitignore \ No newline at end of file diff --git a/rel/vm.args b/rel/vm.args deleted file mode 100644 index f0ff24b..0000000 --- a/rel/vm.args +++ /dev/null @@ -1,30 +0,0 @@ -## This file provide the arguments provided to the VM at startup -## You can find a full list of flags and their behaviours at -## http://erlang.org/doc/man/erl.html - -## Name of the node --name <%= System.get_env("NODENAME") || release_name %>@127.0.0.1 - -## Cookie for distributed erlang --setcookie <%= System.get_env("COOKIE") || release.profile.cookie %> - -## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive -## (Disabled by default..use with caution!) -##-heart - -## Enable kernel poll and a few async threads -##+K true -##+A 5 -## For OTP21+, the +A flag is not used anymore, -## +SDio replace it to use dirty schedulers -##+SDio 5 - -## Increase number of concurrent ports/sockets -##-env ERL_MAX_PORTS 4096 - -## Tweak GC to run more often -##-env ERL_FULLSWEEP_AFTER 10 - -# Enable SMP automatically based on availability -# On OTP21+, this is not needed anymore. --smp auto diff --git a/vagrant_provision.sh b/vagrant_provision.sh new file mode 120000 index 0000000..e1f33a4 --- /dev/null +++ b/vagrant_provision.sh @@ -0,0 +1 @@ +elixir-vagrant-setup/vagrant_provision.sh \ No newline at end of file