-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
448b5ef
commit 5367ddd
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# | ||
# Cookbook Name:: chef-sudo | ||
# Attribute File:: default | ||
# | ||
# Copyright 2013 Matt Farmer | ||
# | ||
# 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. | ||
# | ||
|
||
default['sbt']['version'] = '0.12.4' | ||
default['sbt']['java_options'] = '-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=512M' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name 'sbt' | ||
maintainer 'Matt Farmer' | ||
maintainer_email 'matt@frmr.me' | ||
license 'Apache 2.0' | ||
description 'Installs the sbt version you request from manual download.' | ||
version '0.0.1' | ||
|
||
recipe 'sbt', 'Downloads and installs sbt in your path.' | ||
|
||
%w{ubuntu debian}.each do |os| | ||
supports os | ||
end | ||
|
||
attribute 'sbt', | ||
:display_name => 'SBT', | ||
:description => 'Hash of SBT attributes', | ||
:type => 'hash' | ||
|
||
attribute 'sbt/version', | ||
:display_name => 'SBT Version', | ||
:description => 'The version of SBT to install', | ||
:type => 'string', | ||
:default => '0.12.4' | ||
|
||
attribute 'sbt/java_options', | ||
:display_name => 'SBT Java Options', | ||
:description => 'Java options passed to the JVM running SBT.', | ||
:type => 'string', | ||
:default => '-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=512M' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# | ||
# Cookbook Name:: chef-sbt | ||
# Recipe:: default | ||
# | ||
# Copyright 2013 Matt Farmer | ||
# | ||
# 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. | ||
# | ||
|
||
remote_file "/usr/local/bin/sbt-launch.jar" do | ||
source "http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/#{node[:sbt][:version]}/sbt-launch.jar" | ||
action :create | ||
|
||
not_if "java -jar /usr/local/bin/sbt-launch.jar \"sbt-version\" | tail -1 | awk '{print $2}' | grep '#{node[:sbt][:version]}'" | ||
end | ||
|
||
execute "sudo chown root:root /usr/local/bin/sbt-launch.jar" | ||
execute "sudo chmod 0755 /usr/local/bin/sbt-launch.jar" | ||
|
||
template "/usr/local/bin/sbt" do | ||
source "sbt.erb" | ||
variables({ | ||
:java_options => node[:sbt][:java_options] | ||
}) | ||
|
||
action :create | ||
|
||
owner "root" | ||
group "root" | ||
mode 0755 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
java <%= @java_options %> -jar `dirname $0`/sbt-launch.jar "$@" |