Skip to content
Browse files

Install Erlang releases after building them. Do not provide R13* beca…

…use Makefile seems to be broken for i686-linux (or kerl is).
  • Loading branch information...
1 parent 5f1e59a commit 20a37b62760371c3e09ccdcd0709be41363c86b3 @michaelklishin michaelklishin committed Aug 5, 2011
Showing with 32 additions and 6 deletions.
  1. +2 −2 vagrant_base/kerl/attributes/default.rb
  2. +30 −4 vagrant_base/kerl/recipes/default.rb
View
4 vagrant_base/kerl/attributes/default.rb
@@ -1,5 +1,5 @@
-default[:kerl][:releases] = %w(R13B03 R14B02)
+default[:kerl][:releases] = %w(R14B01 R14B02 R14B03)
default[:kerl][:path] = "/usr/local/bin/kerl"
default[:kerl][:user] = "root"
-default[:kerl][:group] = "root"
+default[:kerl][:group] = "root"
View
34 vagrant_base/kerl/recipes/default.rb
@@ -23,30 +23,44 @@
end # each
end # case
+installation_root = "/home/#{node.kerl.user}/otp"
+
+directory(installation_root) do
+ owner node.kerl.user
+ group node.kerl.group
+ mode "0755"
+ action :create
+end
+
remote_file(node.kerl.path) do
source "https://raw.github.com/spawngrid/kerl/master/kerl"
mode "0755"
end
home = "/home/#{node.kerl.user}"
-env = { 'HOME' => home, 'USER' => node.kerl.user }
+env = {
+ 'HOME' => home,
+ 'USER' => node.kerl.user,
+ 'KERL_DISABLE_AGNER' => 'yes',
+ "KERL_BASE_DIR" => "#{home}/.kerl"
+}
execute "erlang.releases.update" do
command "#{node.kerl.path} update releases"
user node.kerl.user
group node.kerl.group
- environment({'HOME' => home, "KERL_BASE_DIR" => "#{home}/.kerl"})
+
+ environment(env)
# run when kerl script is downloaded & installed
subscribes :run, resources(:remote_file => node.kerl.path)
end
-log(node.kerl.to_hash.inspect)
node.kerl.releases.each do |rel, build|
- execute "install Erlang #{rel}" do
+ execute "build Erlang #{rel}" do
command "#{node.kerl.path} build #{rel} #{rel.downcase}"
user node.kerl.user
@@ -56,4 +70,16 @@
not_if "#{node.kerl.path} list builds | grep #{rel}", :user => node.kerl.user, :environment => env
end
+
+
+ execute "install Erlang #{rel}" do
+ command "#{node.kerl.path} install #{rel.downcase} #{installation_root}/#{rel.downcase}"
+
+ user node.kerl.user
+ group node.kerl.group
+
+ environment(env)
+
+ not_if "#{node.kerl.path} list installations | grep #{rel}", :user => node.kerl.user, :environment => env
+ end
end

0 comments on commit 20a37b6

Please sign in to comment.
Something went wrong with that request. Please try again.