Skip to content

Commit

Permalink
rebar work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
wardbekker committed Aug 19, 2011
1 parent 39246e0 commit b975c39
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vagrant_base/rebar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# DESCRIPTION:

Installs [rebar](https://github.com/basho/rebar.git) for managing Erlang applications.
4 changes: 4 additions & 0 deletions vagrant_base/rebar/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default[:rebar][:path] = "/usr/local/bin/rebar"
default[:rebar][:user] = "vagrant"
default[:rebar][:group] = "vagrant"
default[:rebar][:release] = "https://github.com/basho/rebar/tarball/master"
7 changes: 7 additions & 0 deletions vagrant_base/rebar/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
maintainer "Ward Bekker"
maintainer_email "ward@equanimity.nl"
license "Apache 2.0"
description "Installs rebar for managing Erlang applications."
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.0"
depends "kerl"
31 changes: 31 additions & 0 deletions vagrant_base/rebar/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Cookbook Name:: Rebar
# Recipe:: default
#
# Copyright 2011, Ward Bekker
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

include_recipe('kerl')

remote_file("/tmp/rebar.tar.gz") do
source node.rebar.release
end

execute "active an erlang installation with kerl" do
command "otp=`kerl list installations | head -n 1 | cut -f2 -d\" \"` && source \"$otp/activate\""
end

execute "install rebar" do
command "tar xvf /tmp/rebar.tar.gz rebar && cd /tmp/rebar && ./bootstrap && chmod +x rebar && sudo cp rebar #{node.rebar.path}"
end

0 comments on commit b975c39

Please sign in to comment.