Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

kerl cookbook update, still a WIP

  • Loading branch information...
commit 66ba870573c90964c9252845f657fbdb486e674f 1 parent 5b2c32b
@michaelklishin michaelklishin authored
View
5 vagrant_base/kerl/attributes/default.rb
@@ -0,0 +1,5 @@
+default[:kerl][:releases] = %w(R13B03 R14B02)
+default[:kerl][:path] = "/usr/local/bin/kerl"
+
+default[:kerl][:user] = "root"
+default[:kerl][:group] = "root"
View
41 vagrant_base/kerl/recipes/default.rb
@@ -16,7 +16,46 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-remote_file "/usr/local/bin/kerl" do
+case node['platform']
+when "ubuntu","debian"
+ %w{libreadline5-dev libncurses5-dev libssl-dev}.each do |pkg|
+ package(pkg) { action :install }
+ end # each
+end # case
+
+remote_file(node.kerl.path) do
source "https://raw.github.com/spawngrid/kerl/master/kerl"
mode "0755"
+end
+
+
+home = "/home/#{node.kerl.user}"
+
+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"})
+
+ # 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
+ command "#{node.kerl.path} build #{rel} #{rel.downcase}"
+
+ user node.kerl.user
+ group node.kerl.group
+
+ environment({'HOME' => home, 'USER' => node.kerl.user)
+
+ not_if "#{node.kerl.path} list builds | grep #{rel}"
+
+ # run when kerl has finished updating the list of available releases
+ subscribes :run, resources(:execute => "erlang.releases.update")
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.