bitwalker / distillery-umbrella-test Goto Github PK
View Code? Open in Web Editor NEWAn example Elixir application for working with umbella apps and Distillery.
License: Apache License 2.0
An example Elixir application for working with umbella apps and Distillery.
License: Apache License 2.0
I just cloned and ran
mix deps.get
mix deps.compile
mix release --verbosity=verbose
and it gave me
===> Provider (resolve_release) failed with: {error,
{rlx_prv_release,
{failed_solve,
{unreachable_package,
app_one}}}}
==> Failed to build release. Please fix any errors and try again.
In this example, let's suppose I want to release all applications separately.
is there a way to configure a release so that :
mix release
has the same meaning as
mix release --name app_one
mix release --name app_two
Currently, if I remove the ย default_release: :master_app
clause, then mix release
will only release app_one
. (Not sure it is the expected behavior.)
I looked at the master_app and the apps/master_app/config/config.exs
already contains the settings for app_one and app_two. I assume this is manually added instead of auto generated by exrm, as there isn't any indication that stated master_app is generated by exrm.
Removing the two lines in master_app/config/config.exs,
config :app_one, port: 8090
config :app_two, port: 8091
makes the master_app unable to boot both app_one and app_two, because their respective port configurations becomes unable. Inspecting the generated files master_app.schema.exs and master_app.conf show that they are empty.
It seems that exrm's integration with conform isn't merging in the configurations from the app_one and app_two apps as suggested in the README.md.
After upgrading to the latest exrm v0.19.6, I couldn't get conform to parse the configuration. I'm getting the following exception, which can be replicated in this umbrella test project, with the mix.exs
updated to the latest exrm.
$ mix conform.new
==> The schema for your project has been placed in config/app_one.schema.exs
==> The schema for your project has been placed in config/app_two.schema.exs
==> The schema for your project has been placed in config/master_app.schema.exs
$ mix conform.configure
==> The .conf file for app_one has been placed in config/app_one.conf
==> The .conf file for app_two has been placed in config/app_two.conf
==> The .conf file for master_app has been placed in config/master_app.conf
$ mix conform.effective
** (Conform.Schema.SchemaError) Invalid schema. Should be a keyword list containing :mappings and :translations keys.
lib/conform/translate.ex:169: Conform.Translate.to_config/3
lib/mix/tasks/conform.effective.ex:84: Mix.Tasks.Conform.Effective.do_run/1
(mix) lib/mix/project.ex:196: Mix.Project.in_project/4
(elixir) lib/file.ex:1137: File.cd!/2
lib/mix/tasks/conform.effective.ex:52: anonymous fn/4 in Mix.Tasks.Conform.Effective.run/1
(elixir) lib/enum.ex:1387: Enum."-reduce/3-lists^foldl/2-0-"/3
lib/mix/tasks/conform.effective.ex:51: Mix.Tasks.Conform.Effective.run/1
(mix) lib/mix/cli.ex:55: Mix.CLI.run_task/2
Here's the mix.lock
%{"bbmustache": {:hex, :bbmustache, "1.0.3"},
"conform": {:hex, :conform, "0.16.0"},
"cowboy": {:hex, :cowboy, "1.0.3"},
"cowlib": {:hex, :cowlib, "1.0.1"},
"erlware_commons": {:hex, :erlware_commons, "0.15.0"},
"exrm": {:hex, :exrm, "0.19.6"},
"getopt": {:hex, :getopt, "0.8.2"},
"neotoma": {:hex, :neotoma, "1.7.3"},
"providers": {:hex, :providers, "1.4.1"},
"ranch": {:hex, :ranch, "1.1.0"},
"relx": {:hex, :relx, "3.5.0"}}
Hi -- I have no problem running this app on my Mac.
However, I want to run a similar setup on an ubuntu box I have, and I'm having problems, so I tried running this via Vagrant.
Here's the Vagrantfile:
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 8090, host: 8090
config.vm.network "forwarded_port", guest: 8091, host: 8091
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
config.vm.provision "shell", path: "provision_script.sh"
end
And the provision_script.sh:
# provision_script.sh
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
dpkg -i erlang-solutions_1.0_all.deb
apt-get update
apt-get install -y git
apt-get install -y silversearcher-ag
apt-get install -y build-essential
apt-get install -y esl-erlang
apt-get install -y elixir
echo ""
echo "------------------------------------------------------"
echo "Up!"
echo "------------------------------------------------------"
echo ""
I have a script which builds everything:
#!/bin/bash
for i in app_one app_two master_app ; do
echo "==================================> Cleaing $i"
cd apps/$i
mix clean
mix deps.clean --all
cd ../..
done
for i in app_one app_two master_app ; do
echo "==================================> Building $i"
cd apps/$i
MIX_ENV=prod mix deps.get
MIX_ENV=prod mix deps.compile
MIX_ENV=prod mix compile
cd ../..
done
MIX_ENV=prod mix release --verbosity=verbose
When this finishes, I can run:
apps/master_app/rel/master_app/bin/master_app console
On the Mac, and it builds and runs fine. When I try to run on the ubuntu box (either the real thing or the Vagrant box), it builds fine, but when I try to run it I get:
vagrant@vagrant-ubuntu-trusty-64:/vagrant$ apps/master_app/rel/master_app/bin/master_app console
Using /vagrant/apps/master_app/rel/master_app/releases/0.0.1/master_app.sh
Exec: /vagrant/apps/master_app/rel/master_app/erts-7.3/bin/erlexec -boot /vagrant/apps/master_app/rel/master_app/releases/0.0.1/master_app -boot_var ERTS_LIB_DIR /vagrant/apps/master_app/rel/master_app/erts-7.3/../lib -env ERL_LIBS /vagrant/apps/master_app/rel/master_app/lib -config /vagrant/apps/master_app/rel/master_app/running-config/sys.config -args_file /vagrant/apps/master_app/rel/master_app/running-config/vm.args -user Elixir.IEx.CLI -extra --no-halt +iex -- console
Root: /vagrant/apps/master_app/rel/master_app
/vagrant/apps/master_app/rel/master_app
/vagrant/apps/master_app/rel/master_app/erts-7.3/bin/erlexec: 1: /vagrant/apps/master_app/rel/master_app/erts-7.3/bin/erlexec: Syntax error: word unexpected (expecting ")")
Thanks!
Just tried out the updated version and here's some observations.
conform.new
crashes when master_app/config/config.exs doesn't contain any configuration. Adding a single config allows conform.new
to execute successfully.$ mix conform.new
==> ranch (compile)
==> cowlib (compile)
==> cowboy (compile)
==> The schema for your project has been placed in config/app_one.schema.exs
==> The schema for your project has been placed in config/app_two.schema.exs
** (ArgumentError) argument error
:erlang.byte_size(["[", "extends: ", "[]", ",", "\n ", "import: ", "[]", ",", "\n ", "mappings: ", "[]", ",", "\n ", "transforms: ", "[]", ",", "\n ", "validators: ", "[]", "]"])
lib/conform/schema.ex:289: Conform.Schema.stringify/2
lib/conform/schema.ex:268: Conform.Schema.write_quoted/2
lib/mix/tasks/conform.new.ex:46: Mix.Tasks.Conform.New.do_run/2
(mix) lib/mix/project.ex:196: Mix.Project.in_project/4
(elixir) lib/file.ex:1137: File.cd!/2
lib/mix/tasks/conform.new.ex:20: anonymous fn/3 in Mix.Tasks.Conform.New.run/1
(elixir) lib/enum.ex:1387: Enum."-reduce/3-lists^foldl/2-0-"/3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.