Skip to content
Browse files

Merge branch 'master' of github.com:travis-ci/travis-cookbooks

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
  • Loading branch information...
2 parents c112c93 + 695415b commit a063b674f0d34b43ecda23ffebb13a7a7cb5ebb9 Michael Klishin committed
Showing with 711 additions and 1,569 deletions.
  1. +24 −0 ci_environment/doxygen/recipes/default.rb
  2. +1 −1 ci_environment/gradle/attributes/tarball.rb
  3. +1 −1 ci_environment/java/recipes/oraclejdk7.rb
  4. +4 −1 ci_environment/maven3/recipes/default.rb
  5. +1 −1 ci_environment/memcached/attributes/default.rb
  6. +1 −1 ci_environment/memcached/attributes/ppa.rb
  7. +36 −0 ci_environment/mercurial/recipes/ppa.rb
  8. +5 −5 ci_environment/mongodb/recipes/apt.rb
  9. +0 −2 ci_environment/mysql/templates/default/my.cnf.erb
  10. +0 −2 ci_environment/mysql/templates/default/ramfs/my.cnf.erb
  11. +3 −0 ci_environment/networking_basic/recipes/default.rb
  12. +3 −3 ci_environment/nodejs/attributes/multi.rb
  13. +1 −1 ci_environment/perlbrew/attributes/multi.rb
  14. +3 −0 ci_environment/phantomjs/metadata.rb
  15. +2 −2 ci_environment/php/attributes/default.rb
  16. +4 −3 ci_environment/php/recipes/multi.rb
  17. +2 −2 ci_environment/phpbuild/attributes/default.rb
  18. +1 −1 ci_environment/postgresql/recipes/server_on_ramfs.rb
  19. +2 −2 ci_environment/python/attributes/default.rb
  20. +9 −2 ci_environment/python/recipes/multi.rb
  21. +3 −3 ci_environment/riak/attributes/package.rb
  22. +2 −2 ci_environment/riak/recipes/config.rb
  23. +7 −3 ci_environment/riak/recipes/default.rb
  24. +1 −1 ci_environment/rvm/attributes/default.rb
  25. +22 −0 ci_environment/rvm/recipes/default.rb
  26. +1 −1 ci_environment/rvm/recipes/multi.rb
  27. +2 −0 ci_environment/rvm/templates/default/bundler_config.yml.erb
  28. +20 −0 ci_environment/sbt/CHANGELOG.md
  29. +201 −0 ci_environment/sbt/LICENSE
  30. +78 −2 ci_environment/sbt/README.md
  31. +36 −10 ci_environment/sbt/attributes/default.rb
  32. +27 −17 ci_environment/sbt/metadata.json
  33. +13 −6 ci_environment/sbt/metadata.rb
  34. +101 −51 ci_environment/sbt/recipes/default.rb
  35. +6 −0 ci_environment/sbt/templates/default/jvmopts.erb
  36. +54 −0 ci_environment/sbt/templates/default/sbtopts.erb
  37. +2 −0 ci_environment/travis_build_environment/attributes/default.rb
  38. +0 −2 ci_environment/travis_build_environment/recipes/default.rb
  39. +4 −0 ci_environment/travis_build_environment/recipes/root.rb
  40. +3 −0 ci_environment/xserver/metadata.rb
  41. +0 −24 messaging_broker/build-essential/README.md
  42. +0 −10 messaging_broker/build-essential/metadata.rb
  43. +0 −45 messaging_broker/build-essential/recipes/default.rb
  44. +0 −11 messaging_broker/emacs/metadata.rb
  45. +0 −21 messaging_broker/emacs/recipes/default.rb
  46. +0 −1 messaging_broker/erlang/attributes/default.rb
  47. +0 −11 messaging_broker/erlang/metadata.rb
  48. +0 −27 messaging_broker/erlang/recipes/default.rb
  49. +0 −37 messaging_broker/git/README.rdoc
  50. +0 −16 messaging_broker/git/metadata.rb
  51. +0 −24 messaging_broker/git/recipes/default.rb
  52. +0 −34 messaging_broker/git/recipes/server.rb
  53. +0 −2 messaging_broker/git/templates/default/sv-git-daemon-log-run.erb
  54. +0 −3 messaging_broker/git/templates/default/sv-git-daemon-run.erb
  55. +0 −79 messaging_broker/haproxy/README.md
  56. +0 −22 messaging_broker/haproxy/attributes/default.rb
  57. +0 −13 messaging_broker/haproxy/metadata.rb
  58. +0 −50 messaging_broker/haproxy/recipes/app_lb.rb
  59. +0 −42 messaging_broker/haproxy/recipes/default.rb
  60. +0 −34 messaging_broker/haproxy/templates/default/haproxy-app_lb.cfg.erb
  61. +0 −4 messaging_broker/haproxy/templates/default/haproxy-default.erb
  62. +0 −27 messaging_broker/haproxy/templates/default/haproxy.cfg.erb
  63. +0 −35 messaging_broker/iptables/definitions/iptables_rule.rb
  64. +0 −284 messaging_broker/iptables/files/default/rebuild-iptables
  65. +0 −10 messaging_broker/iptables/metadata.rb
  66. +0 −50 messaging_broker/iptables/recipes/default.rb
  67. +0 −2 messaging_broker/iptables/templates/default/all_established.erb
  68. +0 −2 messaging_broker/iptables/templates/default/all_icmp.erb
  69. +0 −3 messaging_broker/iptables/templates/default/iptables_load.erb
  70. +0 −37 messaging_broker/openssl/README.md
  71. +0 −37 messaging_broker/openssl/libraries/secure_password.rb
  72. +0 −8 messaging_broker/openssl/metadata.rb
  73. +0 −19 messaging_broker/openssl/recipes/default.rb
  74. +0 −86 messaging_broker/rabbitmq/README.md
  75. +0 −10 messaging_broker/rabbitmq/attributes/default.rb
  76. +0 −63 messaging_broker/rabbitmq/metadata.rb
  77. +0 −66 messaging_broker/rabbitmq/providers/user.rb
  78. +0 −34 messaging_broker/rabbitmq/providers/vhost.rb
  79. +0 −35 messaging_broker/rabbitmq/recipes/cluster.rb
  80. +0 −51 messaging_broker/rabbitmq/recipes/default.rb
  81. +0 −25 messaging_broker/rabbitmq/resources/user.rb
  82. +0 −22 messaging_broker/rabbitmq/resources/vhost.rb
  83. +0 −1 messaging_broker/rabbitmq/templates/default/doterlang.cookie.erb
  84. +0 −10 messaging_broker/rabbitmq/templates/default/rabbitmq-env.conf.erb
  85. +0 −5 messaging_broker/rabbitmq/templates/default/rabbitmq_cluster.config.erb
  86. +1 −1 worker_host/travis_worker/metadata.rb
  87. +24 −4 worker_host/travis_worker/recipes/default.rb
  88. +0 −4 worker_host/travis_worker/templates/default/worker.yml.erb
View
24 ci_environment/doxygen/recipes/default.rb
@@ -0,0 +1,24 @@
+#
+# Cookbook Name:: doxygen
+# Recipe:: default
+# Copyright 2012, Travis CI Development Team <contact@travis-ci.org>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+package "doxygen"
View
2 ci_environment/gradle/attributes/tarball.rb
@@ -1,4 +1,4 @@
-gradle_version = "1.2"
+gradle_version = "1.3"
default[:gradle] = {
:version => gradle_version,
View
2 ci_environment/java/recipes/oraclejdk7.rb
@@ -17,7 +17,7 @@
# limitations under the License.
#
-node['java']['java_home'] = node.java.oraclejdk7.java_home
+node.set[:java][:java_home] = node.java.oraclejdk7.java_home
# This recipe relies on a PPA package and is Ubuntu/Debian specific. Please
# keep this in mind.
View
5 ci_environment/maven3/recipes/default.rb
@@ -38,7 +38,10 @@
per_user_settings = File.join(node.travis_build_environment.home, ".m2", "settings.xml")
cookbook_file(per_user_settings) do
- mode 0644
+ owner node.travis_build_environment.user
+ group node.travis_build_environment.group
+
+ mode 0644
action :nothing
end
View
2 ci_environment/memcached/attributes/default.rb
@@ -2,4 +2,4 @@
default[:memcached][:port] = 11211
default[:memcached][:user] = "nobody"
default[:memcached][:listen] = "0.0.0.0"
-default[:memcached][:sasl] = true
+default[:memcached][:sasl] = false
View
2 ci_environment/memcached/attributes/ppa.rb
@@ -1,3 +1,3 @@
include_attribute "memcached::default"
-default[:memcached][:sasl] = true
+default[:memcached][:sasl] = false
View
36 ci_environment/mercurial/recipes/ppa.rb
@@ -0,0 +1,36 @@
+#
+# Cookbook Name:: mercurial
+# Recipe:: default
+# Copyright 2012, Travis CI Development Team <contact@travis-ci.org>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+include_recipe "python::package"
+
+apt_repository "mercurial-ppa" do
+ uri "http://ppa.launchpad.net/mercurial-ppa/releases/ubuntu"
+ distribution node['lsb']['codename']
+ components ["main"]
+ key "323293EE"
+ keyserver "keyserver.ubuntu.com"
+
+ action :add
+end
+
+package "mercurial"
View
10 ci_environment/mongodb/recipes/apt.rb
@@ -20,12 +20,12 @@
# limitations under the License.
#
-node[:mongodb][:installed_from] = "apt"
+node.set[:mongodb][:installed_from] = "apt"
# default settings from apt repo
-node[:mongodb][:datadir] = "/var/lib/mongodb"
-node[:mongodb][:config] = "/etc/mongodb.conf"
-node[:mongodb][:logfile] = "/var/log/mongodb/mongodb.log"
-node[:mongodb][:pidfile] = "/var/run/mongodb.pid"
+node.set[:mongodb][:datadir] = "/var/lib/mongodb"
+node.set[:mongodb][:config] = "/etc/mongodb.conf"
+node.set[:mongodb][:logfile] = "/var/log/mongodb/mongodb.log"
+node.set[:mongodb][:pidfile] = "/var/run/mongodb.pid"
execute "apt-get update" do
View
2 ci_environment/mysql/templates/default/my.cnf.erb
@@ -59,8 +59,6 @@ bind-address = <%= node['mysql']['bind_address'] %>
collation_server = utf8_unicode_ci
character_set_server = utf8
-sql-mode = STRICT_ALL_TABLES
-
#
# * Fine Tuning
View
2 ci_environment/mysql/templates/default/ramfs/my.cnf.erb
@@ -53,8 +53,6 @@ bind-address = <%= node['mysql']['bind_address'] %>
collation_server = utf8_unicode_ci
character_set_server = utf8
-sql-mode = STRICT_ALL_TABLES
-
#
# * Fine Tuning
#
View
3 ci_environment/networking_basic/recipes/default.rb
@@ -25,6 +25,9 @@
'curl',
'wget',
'rsync',
+ # libldap resolves dependency hell around libcurl4-openssl-dev. MK.
+ "libldap-2.4.2",
+ "libldap2-dev",
"libcurl4-openssl-dev"
]
View
6 ci_environment/nodejs/attributes/multi.rb
@@ -1,3 +1,3 @@
-default[:nodejs][:versions] = ["0.6.21"]
-default[:nodejs][:aliases] = { "0.6.21" => "0.6" }
-default[:nodejs][:default] = "0.6.21"
+default[:nodejs][:versions] = ["0.8.14"]
+default[:nodejs][:aliases] = { "0.8.14" => "0.8" }
+default[:nodejs][:default] = "0.8.14"
View
2 ci_environment/perlbrew/attributes/multi.rb
@@ -3,5 +3,5 @@
{ :name => "5.14", :version => "perl-5.14.2" },
{ :name => "5.12", :version => "perl-5.12.4" },
{ :name => "5.10", :version => "perl-5.10.1" }],
- :modules => %w(Dist::Zilla Moose Test::Pod Test::Pod::Coverage Test::Exception Test::Kwalitee Dist::Zilla::Plugin::Bootstrap::lib Catalyst LWP Module::Install Test::Most)
+ :modules => %w(Dist::Zilla Moose Test::Pod Test::Pod::Coverage Test::Exception Test::Kwalitee Dist::Zilla::Plugin::Bootstrap::lib LWP Module::Install Test::Most)
}
View
3 ci_environment/phantomjs/metadata.rb
@@ -0,0 +1,3 @@
+maintainer "Travis CI Development Team"
+license "Apache v2.0'"
+description "Installs/Configures phantomjs"
View
4 ci_environment/php/attributes/default.rb
@@ -1,2 +1,2 @@
-default[:php][:multi][:versions] = ["5.2.17", "5.3.3", "5.3.17", "5.4.7"]
-default[:php][:multi][:aliases] = {"5.2" => "5.2.17", "5.3" => "5.3.17", "5.4" => "5.4.7"}
+default[:php][:multi][:versions] = ["5.2.17", "5.3.3", "5.3.19", "5.4.9", "5.5.0alpha1"]
+default[:php][:multi][:aliases] = {"5.2" => "5.2.17", "5.3" => "5.3.19", "5.4" => "5.4.9", "5.5" => "5.5.0alpha1"}
View
7 ci_environment/php/recipes/multi.rb
@@ -6,9 +6,10 @@
node.php.multi.versions.each do |php_version|
phpbuild_build "#{phpenv_path}/versions" do
- version php_version
- owner node.travis_build_environment.user
- group node.travis_build_environment.group
+ version php_version
+ with_pear !php_version.start_with?('5.5')
+ owner node.travis_build_environment.user
+ group node.travis_build_environment.group
action :create
end
View
4 ci_environment/phpbuild/attributes/default.rb
@@ -1,12 +1,12 @@
default[:phpbuild] = {
:git => {
:repository => "git://github.com/CHH/php-build.git",
- :revision => "30c5486d1a33bec9b104c93504888e78c27753b2"
+ :revision => "7e3a66df91b0879b7289ad519b28fd09b8eabb6f"
},
:phpunit_plugin => {
:git => {
:repository => "git://github.com/CHH/php-build-plugin-phpunit.git",
- :revision => "a6a5ce4a5126b90a02dd473b63f660515de7d183"
+ :revision => "2ee717c0e783809458f3073258c63f42500d1298"
}
},
:custom => {
View
2 ci_environment/postgresql/recipes/server_on_ramfs.rb
@@ -19,7 +19,7 @@
include_recipe "ramfs"
-node[:postgresql][:data_dir] = "#{node[:ramfs][:dir]}/postgresql"
+node.set[:postgresql][:data_dir] = "#{node[:ramfs][:dir]}/postgresql"
include_recipe "postgresql::server"
View
4 ci_environment/python/attributes/default.rb
@@ -18,5 +18,5 @@
# limitations under the License.
#
-default['python']['multi']['pythons'] = %w(python2.5 python2.6 python2.7 python3.1 python3.2 pypy)
-default['python']['pip']['packages'] = %w(nose pytest mock)
+default['python']['multi']['pythons'] = %w(python2.5 python2.6 python2.7 python3.2 python3.3 pypy)
+default['python']['pip']['packages'] = %w(nose pytest mock numpy)
View
11 ci_environment/python/recipes/multi.rb
@@ -92,6 +92,13 @@
end
end
+ packages = if ["python3.3", "3.3", "python3.2", "3.2", "pypy"].include?(py.to_s.downcase)
+ # some versions fail to install NumPy. MK.
+ node.python.pip.packages.reject { |p| p =~ /numpy/ }
+ else
+ node.python.pip.packages
+ end
+
script "preinstall pip packages for virtualenv set 1 (#{py})" do
interpreter "bash"
user node.travis_build_environment.user
@@ -99,7 +106,7 @@
cwd node.travis_build_environment.home
code <<-EOH
- #{installation_root}/#{py}/bin/pip install --quiet #{node.python.pip.packages.join(' ')} --use-mirrors
+ #{installation_root}/#{py}/bin/pip install --quiet #{packages.join(' ')} --use-mirrors
EOH
environment({ "VIRTUAL_ENV_DISABLE_PROMPT" => "true" })
@@ -114,7 +121,7 @@
cwd node.travis_build_environment.home
code <<-EOH
- #{installation_root}/#{py}_with_system_site_packages/bin/pip install --quiet #{node.python.pip.packages.join(' ')} --use-mirrors
+ #{installation_root}/#{py}_with_system_site_packages/bin/pip install --quiet #{packages.join(' ')} --use-mirrors
EOH
environment({ "VIRTUAL_ENV_DISABLE_PROMPT" => "true" })
View
6 ci_environment/riak/attributes/package.rb
@@ -20,11 +20,11 @@
default.riak.package.type = "binary"
if !(node.kernel.machine == "x86_64")
# the only 32 bit package of 1.2.0. MK.
- default.riak.package.url = "http://downloads.basho.com.s3-website-us-east-1.amazonaws.com/riak/CURRENT/ubuntu/lucid/riak_1.2.0-1_i386.deb"
+ default.riak.package.url = "http://downloads.basho.com.s3-website-us-east-1.amazonaws.com/riak/CURRENT/ubuntu/lucid/riak_1.2.1-1_i386.deb"
end
default.riak.package.version.major = "1"
default.riak.package.version.minor = "2"
-default.riak.package.version.incremental = "0"
+default.riak.package.version.incremental = "1"
default.riak.package.version.build = "1"
-default.riak.package.source_checksum = 'e4ca096e5bd8813872dbb182678e91953ec8a5f110030b86a2821496217346a1'
+default.riak.package.source_checksum = '009e9ceb83f7653dfc26ce71220b183e61d8b3e3'
default.riak.package.config_dir = "/etc/riak"
View
4 ci_environment/riak/recipes/config.rb
@@ -41,10 +41,10 @@
# kv.rb
-node.riak.kv.storage_backend = (node.riak.kv.storage_backend).to_s.to_sym
+node.set.riak.kv.storage_backend = (node.riak.kv.storage_backend).to_s.to_sym
# sasl.rb
-node.riak.sasl.errlog_type = (node.riak.sasl.errlog_type).to_s.to_sym
+node.set.riak.sasl.errlog_type = (node.riak.sasl.errlog_type).to_s.to_sym
case node.riak.kv.storage_backend
View
10 ci_environment/riak/recipes/default.rb
@@ -20,6 +20,11 @@
include_recipe "riak::config"
+case node.platform
+when "ubuntu" then
+ include_recipe "libssl::098"
+end
+
if node[:riak][:package][:url]
package_uri = node[:riak][:package][:url]
package_file = package_uri.split("/").last
@@ -31,7 +36,7 @@
case node[:platform]
when "debian","ubuntu"
machines = {"x86_64" => "amd64", "i386" => "i386", "i686" => "i386"}
- base_uri = "#{base_uri}/#{node[:platform]}/#{node[:lsb][:codename]}/"
+ base_uri = "#{base_uri}/#{node[:platform]}/#{node[:lsb][:codename]}/"
when "redhat","centos","scientific","fedora","suse"
machines = {"x86_64" => "x86_64", "i386" => "i386", "i686" => "i686"}
base_uri = "#{base_uri}/rhel/#{node[:platform_version].to_i}/"
@@ -43,7 +48,6 @@
when "binary"
case node[:platform]
when "debian","ubuntu"
- package "libssl0.9.8" if node[:platform_version] >= "11.10"
"#{base_filename.gsub(/\-/, '_')}-#{node[:riak][:package][:version][:build]}_#{machines[node[:kernel][:machine]]}.deb"
when "centos","redhat","suse"
if node[:platform_version].to_i == 6
@@ -97,7 +101,7 @@
options case node[:platform]
when "debian","ubuntu"
"--force-confnew"
- end
+ end
provider value_for_platform(
[ "ubuntu", "debian" ] => {"default" => Chef::Provider::Package::Dpkg},
[ "redhat", "centos", "fedora", "suse" ] => {"default" => Chef::Provider::Package::Rpm}
View
2 ci_environment/rvm/attributes/default.rb
@@ -1 +1 @@
-default[:rvm][:version] = "1.15.13"
+default[:rvm][:version] = "latest-1.17"
View
22 ci_environment/rvm/recipes/default.rb
@@ -74,3 +74,25 @@
source "dot_rvmrc.sh.erb"
end
+
+
+bundler_settings = File.join(node.travis_build_environment.home, ".bundle", "config")
+template bundler_settings do
+ owner node.travis_build_environment.user
+ group node.travis_build_environment.group
+
+ mode 0644
+
+ source "bundler_config.yml.erb"
+ variables Hash[:suffix => node.travis_build_environment.installation_suffix]
+ action :nothing
+end
+
+
+directory(File.join(node.travis_build_environment.home, ".bundle")) do
+ owner node.travis_build_environment.user
+ group node.travis_build_environment.group
+
+ action :create
+ notifies :create, resources(:template => bundler_settings)
+end
View
2 ci_environment/rvm/recipes/multi.rb
@@ -60,7 +60,7 @@
bash "installing #{rb[:name]} with RVM arguments #{rb[:arguments]}" do
setup.call(self)
# another work around for https://github.com/rubinius/rubinius/pull/1759. MK.
- code "#{rvm} #{rb.fetch(:using, default_ruby)} do #{bin_rvm} install #{rb[:name]} -j 3 #{rb[:arguments]} && #{rvm} all do rvm --force gemset empty"
+ code "#{rvm} #{rb.fetch(:using, default_ruby)} do #{bin_rvm} install #{rb[:name]} -j 3 #{rb[:arguments]} && #{rvm} all do rvm --force gemset empty && find ~/.rvm/rubies/ -type d -name .git -print | xargs /bin/rm -rf"
# with all the Rubies we provide, checking for various directories under .rvm/rubies/* is pretty much impossible without
# depending on the exact versions provided. So we use this neat technique suggested by mpapis. MK.
not_if "#{rvm} #{rb[:name]} do echo 'Found'"
View
2 ci_environment/rvm/templates/default/bundler_config.yml.erb
@@ -0,0 +1,2 @@
+api:
+ user_agent_extra: "travis-ci.<%= @suffix %>/1.0.0"
View
20 ci_environment/sbt/CHANGELOG.md
@@ -0,0 +1,20 @@
+# CHANGELOG for sbt-extras cookbook
+
+## 0.2.2
+
+* #4: default recipe is now 100% idempotent
+* #5: User/SBT pre-installation is now coherent and support 0.12 and 0.11 generations.
+
+## 0.2.1
+
+* *administrative* release that only re-packaged 0.2.0, but without unwanted files ('~' backups, .gitignore,...)
+
+## 0.2.0
+
+* #3: *Optional* templates for global config files (/etc/sbt/sbtopts and /etc/sbt/jvmopts)
+* Attributes modified (not backward compatible with 0.1.0)
+* Added timeout on 'execute' resources (sbt/scala downloads)
+
+## 0.1.0
+
+* Initial release
View
201 ci_environment/sbt/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+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.
View
80 ci_environment/sbt/README.md
@@ -1,3 +1,79 @@
-# DESCRIPTION:
+Description
+-----------
-Installs SBT (Simple Build Tool) for building Scala and Java projects.
+This cookbook will install [sbt-extras](https://github.com/paulp/sbt-extras), an alternative script for running [sbt](https://github.com/harrah/xsbt). sbt-extras works with sbt 0.7.x projects as well as 0.10+. If you're in an sbt project directory, the runner will figure out the versions of sbt and scala required by the project and download them if necessary.
+
+The **default** recipe of this Chef cookbook will:
+
+* Download and install the sbt-extras script (e.g. from a github commit/branch/tag)
+* Potentially grant some (or even all) users to download/install on demand the required sbt/scala versions.
+* Optionally deploy some system-wide configuration files (`/etc/sbt/sbtopts` and `/etc/sbt/jvmopts`)
+* Optionally trigger the installation of some sbt/scala dependencies for specific users (see the *'Optional Attributes'* section below)
+
+Requirements
+------------
+
+* Depends on **opscode/java** cookbook
+* Conflicts with **gildegoma/typesafe-stack** cookbook
+
+Attributes
+----------
+
+* `node['sbt-extras']['download_url']` - URL to obtain a specific version of sbt-extras script.
+ * **Note:** we currently refer to an sbt-extras fork version, in order to get **/etc**-style default config files, which is not (yet) a standard feature. See related [pull request](https://github.com/paulp/sbt-extras/pull/36) ...
+ * `node['sbt-extras']['default_sbt_version']` - non-DRY attribute introduced to improve idempotence of default recipe. Such parameter should always match with the default sbt version of sbt-extra script currently installed.
+* `node['sbt-extras']['setup_dir']` - Target directory for installation (default: `/opt/sbt-extras`)
+* `node['sbt-extras']['script_name']` - Name of the installed script (default: `sbt`).
+* `node['sbt-extras']['bin_symlink']` - (optional) sbt-extras script will be linked from this location, *only if this attribute is defined!* (enabled by default to: `/usr/bin/sbt`)
+* `node['sbt-extras']['owner']` - user owner of installed resources (default: `root`)
+* `node['sbt-extras']['group']` - group owner of installed resources (default: `sbt`). **Important:** Members of this group are granted to auto-download/setup on demand any missing versions of sbt (setgid flag is set on `node['sbt-extras']['setup_dir']/.lib` and download files are ``002` umasked.
+* `node['sbt-extras']['group_new_members']` - Members of `node['sbt-extras']['group']`, *to be appended if the group already exists*.
+* `node['sbt-extras']['sbtopts']['mem']` - sbt-extras `-mem <mem>` is used when executing sbt script during chef provisioning. This parameter is also used when installing `/etc/sbt/sbtopts` template (see below)
+* `node['sbt-extras']['config_dir']` - Target directory for global configuration files (default: `/etc/sbt`). The default recipe can potentially install 2 templates in this directory if their filename attribute is not empty (`''`)
+ * `node['sbt-extras']['sbtopts_filename']` - default sbt arguments can be globally set in this file (default: `sbtopts`)
+ * `node['sbt-extras']['jvmopts_filename']` - default jvm arguments can be globally set in this file (disabled by default: `''`, recommended name is `jvmopts`)
+* `node['sbt-extras']['preinstall_cmd']['timeout']` - timeout value when executing sbt to download 'boot' dependencies (default: `300` - 5 minutes)
+* `node['sbt-extras']['preinstall_matrix'][<user_name>][<array of sbt versions>]` - (optional) **user/sbt-versions** matrix to pre-install in `~/.sbt` during chef provisioning. Examples:
+
+```ruby
+node['sbt-extras']['preinstall_matrix']['scala_lover'] = %w{ 0.12.1 0.12.0 0.11.3 0.11.2 0.11.1 }
+node['sbt-extras']['preinstall_matrix']['sbt_tester'] = %w{ 0.12.1-RC2 0.12.1-RC1 }
+```
+
+Installation and Usage
+----------------------
+
+* Find your favourite way (Librarian-Chef, knife-github-cookbooks, Git submodule, Opscode community API or even tarball download) to install this cookbook (and its dependency). **[Librarian](https://github.com/applicationsonline/librarian#readme) is a very nice cookbook bundler!**
+* Include the `sbt-extras::default` recipe to your run list or inside your cookbook.
+* Provision!
+
+Quality Assurance
+-----------------
+
+Cookbook is frequently being _tasted_ by:
+
+* a [foodcritic](http://acrmp.github.com/foodcritic/)
+* Ubuntu 12.10 64-bit, ChefSolo 10.16.2 and java cookbook 1.6.0 (openjdk)
+* CentOS 6.3 64-bit, ChefSolo 10.14.2 and java cookbook 1.6.0 (openjdk)
+
+How to Contribute
+-----------------
+
+*Feel free to open issues, fork repo and send pull request (based on a custom branch, not master)!*
+
+License
+-------
+
+* Copyright:: 2012, Gilles Cornu
+
+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.
View
46 ci_environment/sbt/attributes/default.rb
@@ -1,10 +1,36 @@
-default[:sbt] = {
- :version => "0.11.3",
- :boot => {
- # 5 minutes to install sbt's own dependencies under ~/.sbt/boot. MK.
- :timeout => 300
- },
- :scala => {
- :versions => ["2.9.2", "2.9.1", "2.9.0-1", "2.8.2", "2.8.1"]
- }
-}
+include_attribute 'travis_build_environment'
+
+case platform
+when 'mac_os_x'
+ set['sbt-extras']['user_home_basedir'] = '/Users'
+else # usual base directory on unix systems:
+ set['sbt-extras']['user_home_basedir'] = '/home'
+end
+override['sbt-extras']['user_home_basedir'] = node['travis_build_environment']['home'].split("/#{node['travis_build_environment']['user']}").first
+
+default['sbt-extras']['download_url'] = 'https://github.com/gildegoma/sbt-extras/raw/139803ca3880c20799bca030b33261c4509dc2d5/sbt'
+# Refer to this fork, waiting for https://github.com/paulp/sbt-extras/pull/36 to be accepted and merged into master project.
+default['sbt-extras']['default_sbt_version'] = '0.12.1' # ATTENTION: It must match with effective default sbt of installed script.
+# Note: ideally, the default sbt version should be 'found' in downloaded script content (see issue #7)
+
+default['sbt-extras']['setup_dir'] = '/opt/sbt-extras'
+default['sbt-extras']['script_name'] = 'sbt'
+default['sbt-extras']['owner'] = node['travis_build_environment']['user']
+default['sbt-extras']['group'] = node['travis_build_environment']['group']
+default['sbt-extras']['group_new_members'] = []
+default['sbt-extras']['bin_symlink'] = '/usr/bin/sbt'
+
+default['sbt-extras']['config_dir'] = '/etc/sbt'
+#Template installation is disabled if filename is an empty string:
+default['sbt-extras']['sbtopts_filename'] = 'sbtopts'
+default['sbt-extras']['jvmopts_filename'] = 'jvmopts'
+
+# Following Parameters will be used during recipe execution and also when installing /etc/sbt/sbtopts template
+default['sbt-extras']['sbtopts']['mem'] = 1024 # in megabytes, Tuning of JVM -Xmx and -Xms
+
+default['sbt-extras']['preinstall_cmd']['timeout'] = 300 # A maximum of 5 minutes is allowed to download dependencies of a specific scala version.
+
+# Optionally pre-install dependant libraries of requested sbt versions in user own environment
+default['sbt-extras']['preinstall_matrix'][node['travis_build_environment']['user']] = %w{ 0.12.1 0.12.0 0.11.3 0.11.2 0.11.1 }
+ # Known Problem: sbt 'boot' libraries are correclty installed since 0.11+
+ # (see https://github.com/gildegoma/chef-sbt-extras/issues/5#issuecomment-10576361)
View
44 ci_environment/sbt/metadata.json
@@ -1,32 +1,42 @@
{
"recipes": {
+ "sbt": "Downloads and installs sbt-extras script"
},
+ "attributes": {
+ },
+ "maintainer_email": "git@gilles.cornu.name",
"conflicting": {
+ "typesafe-stack": ">= 0.0.0"
},
"license": "Apache 2.0",
- "long_description": "Installs SBT (Simple Build Tool) 0.10.x for building Scala and Java projects.\n",
- "providing": {
+ "dependencies": {
+ "java": ">= 0.0.0"
},
+ "maintainer": "Gilles Cornu",
+ "description": "Installs sbt-extras to build scala projects with any sbt version you need",
"platforms": {
+ "mac_os_x": ">= 0.0.0",
+ "freebsd": ">= 0.0.0",
+ "amazon": ">= 0.0.0",
+ "scientific": ">= 0.0.0",
+ "suse": ">= 0.0.0",
+ "fedora": ">= 0.0.0",
+ "ubuntu": ">= 0.0.0",
+ "debian": ">= 0.0.0",
+ "redhat": ">= 0.0.0",
+ "centos": ">= 0.0.0"
},
- "maintainer": "Michael S. Klishin",
"replacing": {
},
- "attributes": {
- },
- "maintainer_email": "michael.s.klishin@gmail.com",
- "description": "Installs SBT (Simple Build Tool) 0.11.2 for building Scala and Java projects.",
+ "name": "sbt-extras",
"groupings": {
},
- "version": "1.1.2",
- "recommendations": {
- },
- "name": "sbt",
- "dependencies": {
- "java": [
-
- ]
+ "providing": {
},
"suggestions": {
- }
-}
+ },
+ "recommendations": {
+ },
+ "long_description": "Description\n-----------\n\nThis cookbook will install [sbt-extras](https://github.com/paulp/sbt-extras), an alternative script for running [sbt](https://github.com/harrah/xsbt). sbt-extras works with sbt 0.7.x projects as well as 0.10+. If you're in an sbt project directory, the runner will figure out the versions of sbt and scala required by the project and download them if necessary.\n\nThe **default** recipe of this Chef cookbook will:\n\n* Download and install the sbt-extras script (e.g. from a github commit/branch/tag) \n* Potentially grant some (or even all) users to download/install on demand the required sbt/scala versions.\n* Optionally deploy some system-wide configuration files (`/etc/sbt/sbtopts` and `/etc/sbt/jvmopts`)\n* Optionally trigger the installation of some sbt/scala dependencies for specific users (see the *'Optional Attributes'* section below)\n\nRequirements\n------------\n\n* Depends on **opscode/java** cookbook\n* Conflicts with **gildegoma/typesafe-stack** cookbook\n\nAttributes\n----------\n\n* `node['sbt-extras']['download_url']` - URL to obtain a specific version of sbt-extras script. \n * **Note:** we currently refer to an sbt-extras fork version, in order to get **/etc**-style default config files, which is not (yet) a standard feature. See related [pull request](https://github.com/paulp/sbt-extras/pull/36) ...\n * `node['sbt-extras']['default_sbt_version']` - non-DRY attribute introduced to improve idempotence of default recipe. Such parameter should always match with the default sbt version of sbt-extra script currently installed.\n* `node['sbt-extras']['setup_dir']` - Target directory for installation (default: `/opt/sbt-extras`)\n* `node['sbt-extras']['script_name']` - Name of the installed script (default: `sbt`).\n* `node['sbt-extras']['bin_symlink']` - (optional) sbt-extras script will be linked from this location, *only if this attribute is defined!* (enabled by default to: `/usr/bin/sbt`)\n* `node['sbt-extras']['owner']` - user owner of installed resources (default: `root`)\n* `node['sbt-extras']['group']` - group owner of installed resources (default: `sbt`). **Important:** Members of this group are granted to auto-download/setup on demand any missing versions of sbt (setgid flag is set on `node['sbt-extras']['setup_dir']/.lib` and download files are ``002` umasked.\n* `node['sbt-extras']['group_new_members']` - Members of `node['sbt-extras']['group']`, *to be appended if the group already exists*.\n* `node['sbt-extras']['sbtopts']['mem']` - sbt-extras `-mem <mem>` is used when executing sbt script during chef provisioning. This parameter is also used when installing `/etc/sbt/sbtopts` template (see below)\n* `node['sbt-extras']['config_dir']` - Target directory for global configuration files (default: `/etc/sbt`). The default recipe can potentially install 2 templates in this directory if their filename attribute is not empty (`''`)\n * `node['sbt-extras']['sbtopts_filename']` - default sbt arguments can be globally set in this file (default: `sbtopts`)\n * `node['sbt-extras']['jvmopts_filename']` - default jvm arguments can be globally set in this file (disabled by default: `''`, recommended name is `jvmopts`)\n* `node['sbt-extras']['preinstall_cmd']['timeout']` - timeout value when executing sbt to download 'boot' dependencies (default: `300` - 5 minutes)\n* `node['sbt-extras']['preinstall_matrix'][<user_name>][<array of sbt versions>]` - (optional) **user/sbt-versions** matrix to pre-install in `~/.sbt` during chef provisioning. Examples: \n\n```ruby\nnode['sbt-extras']['preinstall_matrix']['scala_lover'] = %w{ 0.12.1 0.12.0 0.11.3 0.11.2 0.11.1 }\nnode['sbt-extras']['preinstall_matrix']['sbt_tester'] = %w{ 0.12.1-RC2 0.12.1-RC1 }\n``` \n\nInstallation and Usage\n----------------------\n\n* Find your favourite way (Librarian-Chef, knife-github-cookbooks, Git submodule, Opscode community API or even tarball download) to install this cookbook (and its dependency). **[Librarian](https://github.com/applicationsonline/librarian#readme) is a very nice cookbook bundler!**\n* Include the `sbt-extras::default` recipe to your run list or inside your cookbook.\n* Provision!\n\nQuality Assurance\n-----------------\n\nCookbook is frequently being _tasted_ by:\n\n* a [foodcritic](http://acrmp.github.com/foodcritic/)\n* Ubuntu 12.10 64-bit, ChefSolo 10.16.2 and java cookbook 1.6.0 (openjdk)\n* CentOS 6.3 64-bit, ChefSolo 10.14.2 and java cookbook 1.6.0 (openjdk)\n\nHow to Contribute\n-----------------\n\n*Feel free to open issues, fork repo and send pull request (based on a custom branch, not master)!*\n\nLicense\n-------\n\n* Copyright:: 2012, Gilles Cornu\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
+ "version": "0.2.2"
+}
View
19 ci_environment/sbt/metadata.rb
@@ -1,8 +1,15 @@
-maintainer "Michael S. Klishin"
-maintainer_email "michael.s.klishin@gmail.com"
+maintainer "Gilles Cornu"
+maintainer_email "git@gilles.cornu.name"
license "Apache 2.0"
-description "Installs SBT (Simple Build Tool) 0.11.x for building Scala and Java projects."
+description "Installs sbt-extras to build scala projects with any sbt version you need"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "1.1.2"
-platforms
-depends "java"
+version "0.2.2"
+
+depends "java"
+conflicts "typesafe-stack"
+
+%w{ debian ubuntu centos redhat fedora scientific suse amazon freebsd mac_os_x }.each do |os|
+ supports os
+end
+
+recipe "sbt", "Downloads and installs sbt-extras script"
View
152 ci_environment/sbt/recipes/default.rb
@@ -1,69 +1,119 @@
#
-# Cookbook Name:: sbt
+# Cookbook Name:: sbt-extras
# Recipe:: default
#
-# Copyright 2011-2012, Michael S. Klishin
-# Copyright 2011-2012, Travis CI Development Team
+# Copyright 2012, Gilles Cornu
#
-# 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 "java"
-require "tmpdir"
-
-include_recipe "libssl::098"
+script_absolute_path = File.join(node['sbt-extras']['setup_dir'], node['sbt-extras']['script_name'])
+tmp_project_dir = File.join(Chef::Config[:file_cache_path], 'setup-sbt-extras-tmp-project')
-# This recipe uses homegrown .deb package built with sbt-installer-ubuntizer scripts
-# originally developed by Przemek Pokrywka.
-# See https://github.com/michaelklishin/sbt-installer-ubuntizer
-
-tmp = Dir.tmpdir
-case node[:platform]
-when "debian", "ubuntu"
- ["sbt-#{node.sbt.version}.deb"].each do |deb|
- path = File.join(tmp, deb)
+# Create (or modify) the group of sbt-extras power users (allowed to install new versions of sbt)
+group node['sbt-extras']['group'] do
+ members node['sbt-extras']['group_new_members']
+ append true # add new members, if the group already exists
+end
- remote_file(path) do
- v = node.sbt.version
+directory File.join(node['sbt-extras']['setup_dir'], '.lib') do
+ recursive true
+ owner node['sbt-extras']['owner']
+ group node['sbt-extras']['group']
+ mode '2775' # enable 'setgid' flag to force group ID inheritance on sub-elements
+end
- owner node.travis_build_environment.user
- group node.travis_build_environment.group
- source "http://files.travis-ci.org/packages/deb/sbt/#{deb}"
+# Download sbt-extras script
+remote_file script_absolute_path do
+ source node['sbt-extras']['download_url']
+ backup false
+ mode '0755'
+ owner node['sbt-extras']['owner']
+ group node['sbt-extras']['group']
+end
- not_if "which sbt"
- end
+# Optionally create a symlink (typically to be part of default PATH, example: /usr/bin/sbt)
+link node['sbt-extras']['bin_symlink'] do
+ to script_absolute_path
+ owner node['sbt-extras']['owner']
+ group node['sbt-extras']['group']
+ not_if { node['sbt-extras']['bin_symlink'].nil? }
+end
- package(deb) do
- action :install
- source path
- provider Chef::Provider::Package::Dpkg
+# Install default config files
+directory node['sbt-extras']['config_dir'] do
+ owner node['sbt-extras']['owner']
+ group node['sbt-extras']['group']
+ mode '0755'
+end
+template File.join(node['sbt-extras']['config_dir'], node['sbt-extras']['sbtopts_filename']) do
+ source "sbtopts.erb"
+ owner node['sbt-extras']['owner']
+ group node['sbt-extras']['group']
+ mode '0664'
+ variables(
+ :arg_mem => node['sbt-extras']['sbtopts']['mem']
+ )
+end
+template File.join(node['sbt-extras']['config_dir'], node['sbt-extras']['jvmopts_filename']) do
+ source "jvmopts.erb"
+ owner node['sbt-extras']['owner']
+ group node['sbt-extras']['group']
+ mode '0664'
+ not_if do
+ node['sbt-extras']['jvmopts_filename'].empty?
+ end
+end
- not_if "which sbt"
- end
- end # each
-end # case
+# Start sbt, to force download and setup of default sbt-laucher
+unless File.directory?(File.join(node['sbt-extras']['setup_dir'], '.lib', node['sbt-extras']['default_sbt_version']))
+ directory tmp_project_dir do
+ # Create a very-temporary folder to store dummy project files, created by '-sbt-create' arg
+ mode '0777'
+ end
+ execute "Forcing sbt-extras to install its default sbt version" do
+ command "#{script_absolute_path} -mem #{node['sbt-extras']['sbtopts']['mem']} -batch -sbt-create"
+ user node['sbt-extras']['owner']
+ group node['sbt-extras']['group']
+ umask '002' # grant write permission to group.
+ cwd tmp_project_dir
+ timeout node['sbt-extras']['preinstall_cmd']['timeout']
+ # ATTENTION: chef-execute switch to user, but keep original environment variables (e.g. HOME=/root)
+ environment ( { 'HOME' => tmp_project_dir } ) # .sbt/.ivy2 files won't be kept.
+ end
+ directory tmp_project_dir do
+ action :delete
+ recursive true
+ end
+end
+# Optionally download and pre-install libraries of sbt version-matrix in user own environment
+if node['sbt-extras']['preinstall_matrix']
+ node['sbt-extras']['preinstall_matrix'].keys.each do |sbt_user|
+ node['sbt-extras']['preinstall_matrix'][sbt_user].each do |sbt_version|
+ unless File.directory?(File.join(node['sbt-extras']['user_home_basedir'], sbt_user, '.sbt', sbt_version))
+ directory tmp_project_dir do
+ # Create a very-temporary folder to store dummy project files, created by '-sbt-create' arg
+ mode '0777'
+ end
+ execute "running sbt-extras as user #{sbt_user} to pre-install libraries of sbt #{sbt_version}" do
-node[:sbt][:scala][:versions].each do |version|
- execute "force sbt to download its own dependencies (for scala #{version})" do
- # we have to use "help" here because many other commands will cause
- # sbt to start its interactive REPL session and that will block the entire
- # chef run. We also must set cwd or the run will stall. MK.
- command "sbt ++#{version} help compile < /dev/null"
- user node.travis_build_environment.user
- cwd node.travis_build_environment.home
+ # ATTENTION: current command only supports sbt 0.11+. See Issues #9 and #10.
+ command "#{script_absolute_path} -mem #{node['sbt-extras']['sbtopts']['mem']} -batch -sbt-version #{sbt_version} -sbt-create"
+ user sbt_user
+ group node['sbt-extras']['group']
+ umask '002' # grant write permission to group.
+ cwd tmp_project_dir
+ timeout node['sbt-extras']['preinstall_cmd']['timeout']
- timeout node[:sbt][:boot][:timeout]
- action :run
+ # ATTENTION: chef-execute switch to user, but keep original environment variables (e.g. HOME=/root)
+ environment ( { 'HOME' => File.join(node['sbt-extras']['user_home_basedir'], sbt_user) } )
+ end
+ directory tmp_project_dir do
+ action :delete
+ recursive true
+ end
+ end
+ end
end
end
View
6 ci_environment/sbt/templates/default/jvmopts.erb
@@ -0,0 +1,6 @@
+-XX:ReservedCodeCacheSize=96M
+-Xms1024M
+-Xmx1536M
+-Xss6M
+-XX:+CMSClassUnloadingEnabled
+-XX:MaxPermSize=384M
View
54 ci_environment/sbt/templates/default/sbtopts.erb
@@ -0,0 +1,54 @@
+# ------------------------------------------------ #
+# The SBT Configuration file. #
+# ------------------------------------------------ #
+
+# in Travis CI, never prompt!
+-batch
+
+# Disable ANSI color codes
+#
+#-no-colors
+
+# Starts sbt even if the current directory contains no sbt project.
+#
+#-sbt-create
+
+# Path to global settings/plugins directory (default: ~/.sbt)
+#
+#-sbt-dir /etc/sbt
+
+# Path to shared boot directory (default: ~/.sbt/boot in 0.11 series)
+#
+#-sbt-boot ~/.sbt/boot
+
+# Path to local Ivy repository (default: ~/.ivy2)
+#
+#-ivy ~/.ivy2
+
+# set memory options
+#
+#-mem <integer>
+
+<% if @arg_mem %>
+-mem <%= @arg_mem %>
+<% end %>
+
+# Use local caches for projects, no sharing.
+#
+#-no-share
+
+# Put SBT in offline mode.
+#
+#-offline
+
+# Sets the SBT version to use.
+#-sbt-version 0.11.3
+
+# Scala version (default: latest release)
+#
+#-scala-home <path>
+#-scala-version <version>
+
+# java version (default: java from PATH, currently $(java -version |& grep version))
+#
+#-java-home <path>
View
2 ci_environment/travis_build_environment/attributes/default.rb
@@ -7,6 +7,8 @@
:hosts => Hash.new,
:builds_volume_size => "350m",
:use_tmpfs_for_builds => true,
+ # "org" or "com"
+ :installation_suffix => "org",
:apt => {
# in seconds
View
2 ci_environment/travis_build_environment/recipes/default.rb
@@ -29,8 +29,6 @@
include_recipe "unarchivers"
-include_recipe "emacs"
-
include_recipe "travis_build_environment::root"
include_recipe "travis_build_environment::ci_user"
View
4 ci_environment/travis_build_environment/recipes/root.rb
@@ -42,3 +42,7 @@
cron "make sure eth0 is up" do
command "/usr/local/bin/recover_eth0.sh"
end
+
+execute "/opt/ruby/bin/gem install chef" do
+ user "root"
+end
View
3 ci_environment/xserver/metadata.rb
@@ -0,0 +1,3 @@
+maintainer "Travis CI Development Team"
+license "Apache v2.0'"
+description "Installs/Configures xserver"
View
24 messaging_broker/build-essential/README.md
@@ -1,24 +0,0 @@
-DESCRIPTION
-===========
-
-Installs packages required for compiling C software from source.
-
-LICENSE AND AUTHOR
-==================
-
-Author:: Joshua Timberman (<joshua@opscode.com>)
-Author:: Seth Chisamore (<schisamo@opscode.com>)
-
-Copyright 2009-2011, Opscode, Inc.
-
-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.
View
10 messaging_broker/build-essential/metadata.rb
@@ -1,10 +0,0 @@
-maintainer "Opscode, Inc."
-maintainer_email "cookbooks@opscode.com"
-license "Apache 2.0"
-description "Installs C compiler / build tools"
-version "1.0.0"
-recipe "build-essential", "Installs C compiler and build tools on Linux"
-
-%w{ fedora redhat centos ubuntu debian }.each do |os|
- supports os
-end
View
45 messaging_broker/build-essential/recipes/default.rb
@@ -1,45 +0,0 @@
-#
-# Cookbook Name:: build-essential
-# Recipe:: default
-#
-# Copyright 2008-2009, Opscode, Inc.
-#
-# 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.
-#
-
-case node['platform']
-when "ubuntu","debian"
- %w{build-essential binutils-doc}.each do |pkg|
- package pkg do
- action :install
- end
- end
-when "centos","redhat","fedora"
- %w{gcc gcc-c++ kernel-devel make}.each do |pkg|
- package pkg do
- action :install
- end
- end
-end
-
-package "autoconf" do
- action :install
-end
-
-package "flex" do
- action :install
-end
-
-package "bison" do
- action :install
-end
View
11 messaging_broker/emacs/metadata.rb
@@ -1,11 +0,0 @@
-maintainer "Opscode, Inc."
-maintainer_email "cookbooks@opscode.com"
-license "Apache 2.0"
-description "Installs emacs"
-version "0.7"
-
-recipe "emacs", "Installs Emacs"
-
-%w{ ubuntu debian redhat centos }.each do |os|
- supports os
-end
View
21 messaging_broker/emacs/recipes/default.rb
@@ -1,21 +0,0 @@
-#
-# Cookbook Name:: emacs
-# Recipe:: default
-#
-# Copyright 2009, Opscode, Inc.
-#
-# 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.
-#
-package "emacs" do
- action :upgrade
-end
View
1 messaging_broker/erlang/attributes/default.rb
@@ -1 +0,0 @@
-default[:erlang][:gui_tools] = false
View
11 messaging_broker/erlang/metadata.rb
@@ -1,11 +0,0 @@
-maintainer "Opscode, Inc."
-maintainer_email "cookbooks@opscode.com"
-license "Apache 2.0"
-description "Installs erlang, optionally install GUI tools."
-version "0.8.2"
-
-recipe "erlang", "Installs erlang"
-
-%w{ ubuntu debian }.each do |os|
- supports os
-end
View
27 messaging_broker/erlang/recipes/default.rb
@@ -1,27 +0,0 @@
-# Cookbook Name:: erlang
-# Recipe:: default
-# Author:: Joe Williams <joe@joetify.com>
-#
-# Copyright 2008-2009, Joe Williams
-#
-# 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.
-#
-
-case node[:platform]
-when "debian", "ubuntu"
- erlpkg = node[:erlang][:gui_tools] ? "erlang" : "erlang-nox"
- package erlpkg
- package "erlang-dev"
-else
- package "erlang"
-end
View
37 messaging_broker/git/README.rdoc
@@ -1,37 +0,0 @@
-= DESCRIPTION:
-
-Installs git.
-
-= REQUIREMENTS:
-
-== Cookbooks:
-
-Opscode Cookbooks (http://github.com/opscode/cookbooks/tree/master)
-
-* runit
-
-= USAGE:
-
-This cookbook primarily installs git core packages. It can also be used to serve git repositories.
-
- include_recipe "git::server"
-
-This creates the directory /srv/git and starts a git daemon, exporting all repositories found. Repositories need to be added manually, but will be available once they are created.
-
-= LICENSE and AUTHOR:
-
-Author:: Joshua Timberman (<joshua@opscode.com>)
-
-Copyright:: 2009, Opscode, Inc
-
-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.
View
16 messaging_broker/git/metadata.rb
@@ -1,16 +0,0 @@
-maintainer "Opscode, Inc."
-maintainer_email "cookbooks@opscode.com"
-license "Apache 2.0"
-description "Installs git and/or sets up a Git server daemon"
-long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
-version "0.9.0"
-recipe "git", "Installs git"
-recipe "git::server", "Sets up a runit_service for git daemon"
-
-%w{ ubuntu debian arch}.each do |os|
- supports os
-end
-
-%w{ runit }.each do |cb|
- depends cb
-end
View
24 messaging_broker/git/recipes/default.rb
@@ -1,24 +0,0 @@
-#
-# Cookbook Name:: git
-# Recipe:: default
-#
-# Copyright 2008-2009, Opscode, Inc.
-#
-# 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.
-
-case node[:platform]
-when "debian", "ubuntu"
- package "git-core"
-else
- package "git"
-end
View
34 messaging_broker/git/recipes/server.rb
@@ -1,34 +0,0 @@
-#
-# Cookbook Name:: git
-# Recipe:: server
-#
-# Copyright 2009, Opscode, Inc.
-#
-# 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 "git"
-
-directory "/srv/git" do
- owner "root"
- group "root"
- mode 0755
-end
-
-case node[:platform]
-when "debian", "ubuntu"
- include_recipe "runit"
- runit_service "git-daemon"
-else
- log "Platform requires setting up a git daemon service script."
- log "Hint: /usr/bin/git daemon --export-all --user=nobody --group=daemon --base-path=/srv/git"
-end
View
2 messaging_broker/git/templates/default/sv-git-daemon-log-run.erb
@@ -1,2 +0,0 @@
-#!/bin/sh
-exec svlogd -tt ./main
View
3 messaging_broker/git/templates/default/sv-git-daemon-run.erb
@@ -1,3 +0,0 @@
-#!/bin/sh
-exec 2>&1
-exec /usr/bin/git daemon --export-all --user=nobody --group=daemon --base-path=/srv/git /srv/git
View
79 messaging_broker/haproxy/README.md
@@ -1,79 +0,0 @@
-Description
-===========
-
-Installs haproxy and prepares the configuration location.
-
-Changes
-=======
-
-## v1.0.2:
-
-* fix regression introduced in v1.0.1
-
-## v1.0.1:
-
-* account for the case where load balancer is in the pool
-
-## v1.0.0:
-
-* Use `node.chef_environment` instead of `node['app_environment']`
-
-Requirements
-============
-
-## Platform
-
-Tested on Ubuntu 8.10 and higher.
-
-## Cookbooks:
-
-Attributes
-==========
-
-* `node['haproxy']['member_port']` - the port that member systems will be listening on, default 80
-* `node['haproxy']['enable_admin']` - whether to enable the admin interface. default true. Listens on port 22002.
-* `node['haproxy']['app_server_role']` - used by the `app_lb` recipe to search for a specific role of member systems. Default `webserver`.
-
-Usage
-=====
-
-Use either the default recipe or the `app_lb` recipe.
-
-When using the default recipe, modify the haproxy.cfg.erb file with listener(s) for your sites/servers.
-
-The app_lb recipe is designed to be used with the application cookbook, and provides search mechanism to find the appropriate application servers. Set this in a role that includes the haproxy::app_lb recipe. For example,
-
- name "load_balancer"
- description "haproxy load balancer"
- run_list("recipe[haproxy::app_lb]")
- override_attributes(
- "haproxy" => {
- "app_server_role" => "webserver"
- }
- )
-
-The search uses the node's `chef_environment`. For example, create `environments/production.rb`, then upload it to the server with knife
-
- % cat environments/production.rb
- name "production"
- description "Nodes in the production environment."
- % knife environment from file production.rb
-
-License and Author
-==================
-
-Author:: Joshua Timberman (<joshua@opscode.com>)
-
-Copyright:: 2009-2011, Opscode, Inc
-
-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.
View
22 messaging_broker/haproxy/attributes/default.rb
@@ -1,22 +0,0 @@
-#
-# Cookbook Name:: haproxy
-# Default:: default
-#
-# Copyright 2010, Opscode, Inc.
-#
-# 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['haproxy']['member_port'] = "8080"
-default['haproxy']['enable_admin'] = true
-default['haproxy']['app_server_role'] = "webserver"
View
13 messaging_broker/haproxy/metadata.rb
@@ -1,13 +0,0 @@
-maintainer "Opscode, Inc."
-maintainer_email "cookbooks@opscode.com"
-license "Apache 2.0"
-description "Installs and configures haproxy"
-long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "1.0.2"
-
-recipe "haproxy", "Installs and configures haproxy"
-recipe "haproxy::app_lb", "Installs and configures haproxy by searching for nodes of a particular role"
-
-%w{ debian ubuntu }.each do |os|
- supports os
-end
View
50 messaging_broker/haproxy/recipes/app_lb.rb
@@ -1,50 +0,0 @@
-#
-# Cookbook Name:: haproxy
-# Recipe:: app_lb
-#
-# Copyright 2011, Opscode, Inc.
-#
-# 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.
-#
-
-pool_members = search("node", "role:#{node['haproxy']['app_server_role']} AND chef_environment:#{node.chef_environment}") || []
-
-# load balancer is in the pool
-if node.run_list.roles.include?(node['haproxy']['app_server_role'])
- pool_members << node
-end
-
-package "haproxy" do
- action :install
-end
-
-template "/etc/default/haproxy" do
- source "haproxy-default.erb"
- owner "root"
- group "root"
- mode 0644
-end
-
-service "haproxy" do
- supports :restart => true, :status => true, :reload => true
- action [:enable, :start]
-end
-
-template "/etc/haproxy/haproxy.cfg" do
- source "haproxy-app_lb.cfg.erb"
- owner "root"
- group "root"
- mode 0644
- variables :pool_members => pool_members.uniq
- notifies :restart, "service[haproxy]"
-end
View
42 messaging_broker/haproxy/recipes/default.rb
@@ -1,42 +0,0 @@
-#
-# Cookbook Name:: haproxy
-# Recipe:: default
-#
-# Copyright 2009, Opscode, Inc.
-#
-# 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.
-#
-
-package "haproxy" do
- action :install
-end
-
-template "/etc/default/haproxy" do
- source "haproxy-default.erb"
- owner "root"
- group "root"
- mode 0644
-end
-
-service "haproxy" do
- supports :restart => true, :status => true, :reload => true
- action [:enable, :start]
-end
-
-template "/etc/haproxy/haproxy.cfg" do
- source "haproxy.cfg.erb"
- owner "root"
- group "root"
- mode 0644
- notifies :restart, "service[haproxy]"
-end
View
34 messaging_broker/haproxy/templates/default/haproxy-app_lb.cfg.erb
@@ -1,34 +0,0 @@
-global
- log 127.0.0.1 local0
- log 127.0.0.1 local1 notice
- #log loghost local0 info
- maxconn 4096
- #debug
- #quiet
- user haproxy
- group haproxy
-
-defaults
- log global
- mode http
- option httplog
- option dontlognull
- retries 3
- redispatch
- maxconn 2000
- contimeout 5000
- clitimeout 50000
- srvtimeout 50000
-
-# Set up application listeners here.
-listen application 0.0.0.0:80
- balance roundrobin
- <% @pool_members.each do |member| -%>
- <% server_ip = member.has_key?("ec2") ? member["ec2"]["public_ipv4"] : member["ipaddress"] -%>
- server <%= member["hostname"] %> <%= server_ip %>:<%= node["haproxy"]["member_port"] %> weight 1 maxconn 1 check
- <% end -%>
-<% if node["haproxy"]["enable_admin"] -%>
-listen admin 0.0.0.0:22002
- mode http
- stats uri /
-<% end -%>
View
4 messaging_broker/haproxy/templates/default/haproxy-default.erb
@@ -1,4 +0,0 @@
-# Set ENABLED to 1 if you want the init script to start haproxy.
-ENABLED=1
-# Add extra flags here.
-#EXTRAOPTS="-de -m 16"
View
27 messaging_broker/haproxy/templates/default/haproxy.cfg.erb
@@ -1,27 +0,0 @@
-global
- log 127.0.0.1 local0
- log 127.0.0.1 local1 notice
- #log loghost local0 info
- maxconn 4096
- #debug
- #quiet
- user haproxy
- group haproxy
-
-defaults
- log global
- mode http
- option httplog
- option dontlognull
- retries 3
- redispatch
- maxconn 2000
- contimeout 5000
- clitimeout 50000
- srvtimeout 50000
-
-# Set up application listeners here.
-listen application 0.0.0.0:8400
- balance roundrobin
- server localhost 127.0.0.1:4000 weight 1 maxconn 5 check
- server localhost 127.0.0.1:4001 weight 1 maxconn 5 check
View
35 messaging_broker/iptables/definitions/iptables_rule.rb
@@ -1,35 +0,0 @@
-#
-# Cookbook Name:: iptables
-# Definition:: iptables_rule
-#
-# Copyright 2008-2009, Opscode, Inc.
-#
-# 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.
-#
-
-define :iptables_rule, :enable => true, :source => nil, :variables => {} do
- template_source = params[:source] ? params[:source] : "#{params[:name]}.erb"
-
- template "/etc/iptables.d/#{params[:name]}" do
- source template_source
- mode 0644
- variables params[:variables]
- backup false
- notifies :run, resources(:execute => "rebuild-iptables")
- if params[:enable]
- action :create
- else
- action :delete
- end
- end
-end
View
284 messaging_broker/iptables/files/default/rebuild-iptables
@@ -1,284 +0,0 @@
-#!/usr/bin/perl -w
-our $ID = q$Id: rebuild-iptables 344 2006-10-04 02:48:30Z digant $;
-
-#
-# rebuild-iptables -- Construct an iptables rules file from fragments.
-#
-# Written by Russ Allbery <rra@stanford.edu>
-# Adapted by Digant C Kasundra <digant@stanford.edu>
-# Adapted by Joe Williams (2011) <joe@joetify.com>
-# Copyright 2005, 2006 Board of Trustees, Leland Stanford Jr. University
-#
-# Constructs an iptables rules file from the prefix, standard, and suffix
-# files in the iptables configuration area, adding any additional modules
-# specified in the command line, and prints the resulting iptables rules to
-# standard output (suitable for saving into /var/lib/iptables or some other
-# appropriate location on the system).
-
-##############################################################################
-# Modules and declarations
-##############################################################################
-
-require 5.006;
-use strict;
-
-use Getopt::Long qw(GetOptions);
-
-# Path to the iptables template area.
-our $TEMPLATE = '/etc/iptables.d';
-
-##############################################################################
-# Installation
-##############################################################################
-
-# Return the prefix
-sub prefix {
- my $data;
- ( $data = <<'END_OF_PREFIX' ) =~ s/^\s+//gm;
- *filter
- :INPUT ACCEPT
- :FORWARD ACCEPT
- :OUTPUT ACCEPT
- :FWR -
- -A INPUT -j FWR
- -A FWR -i lo -j ACCEPT
-END_OF_PREFIX
-
- return $data;
-}
-
-# Return the suffix
-sub suffix {
- my $data;
- ( $data = <<'END_OF_SUFFIX' ) =~ s/^\s+//gm;
- # Rejects all remaining connections with port-unreachable errors.
-
- -A FWR -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j REJECT --reject-with icmp-port-unreachable
- -A FWR -p udp -j REJECT --reject-with icmp-port-unreachable
- COMMIT
-END_OF_SUFFIX
-
- return $data;
-}
-
-sub snat {
- my $data = "";
- if ( -f "/etc/iptables.snat" ) {
- open( SNAT, "<", "/etc/iptables.snat" )
- or die "$0: cannot open /etc/iptables.snat: $!\n";
- while (<SNAT>) {
- $data = $data . $_;
- }
- close(SNAT);
- }
- return $data;
-}
-
-# Read in a file, processing includes as required. Returns the contents of
-# the file as an array.
-sub read_iptables {
- my ($file) = @_;
- my @data;
- $file = $TEMPLATE . '/' . $file unless $file =~ m%^\.?/%;
- local *MODULE;
- open( MODULE, '<', $file ) or die "$0: cannot open $file: $!\n";
- local $_;
- while (<MODULE>) {
- if (/^\s*include\s+(\S+)$/) {
- my $included = $1;
- $included = $TEMPLATE . '/' . $included
- unless $included =~ m%^\.?/%;
- if ( $file eq $included ) {
- die "$0: include loop in $file, line $.\n";
- }
- push( @data, "\n" );
- push( @data, read_iptables($included) );
- push( @data, "\n" );
- } elsif (/^\s*include\s/) {
- die "$0: malformed include line in $file, line $.\n";
- } else {
- push( @data, $_ );
- }
- }
- close MODULE;
- return @data;
-}
-
-# Write a file carefully.
-sub write_iptables {
- my ( $file, @data ) = @_;
- open( NEW, "> $file.new" ) or die "$0: cannot create $file.new: $!\n";
- print NEW @data or die "$0: cannot write to $file.new: $!\n";
- close NEW or die "$0: cannot flush $file.new: $!\n";
- rename( "$file.new", $file )
- or die "$0: cannot install new $file: $!\n";
-}
-
-# Install iptables on a Red Hat system. Takes the array containing the new
-# iptables data.
-sub install_redhat {
- my (@data) = @_;
- write_iptables( '/etc/sysconfig/iptables', @data );
- system( "/sbin/service", "iptables", "restart" );
-}
-
-# Install iptables on a Debian system. Take the array containing the new
-# iptables data.
-sub install_debian {
- my (@data) = @_;
- unless ( -d '/etc/iptables' ) {
- mkdir( '/etc/iptables', 0755 )
- or die "$0: cannot mkdir /etc/iptables: $!\n";
- }
- write_iptables( "/etc/iptables/general", @data );
- system("/sbin/iptables-restore < /etc/iptables/general") == 0
- or die "rebuild-iptables: iptables-restore failed! - $?"
-}
-
-##############################################################################
-# Main routine
-##############################################################################
-
-# Fix things up for error reporting.
-$| = 1;
-my $fullpath = $0;
-$0 =~ s%.*/%%;
-
-# Parse command-line options.
-my ( $help, $version );
-Getopt::Long::config( 'bundling', 'no_ignore_case' );
-GetOptions(
- 'h|help' => \$help,
- 'v|version' => \$version
-) or exit 1;
-if ($help) {
- print "Feeding myself to perldoc, please wait....\n";
- exec( 'perldoc', '-t', $fullpath );
-} elsif ($version) {
- my $version = join( ' ', ( split( ' ', $ID ) )[ 1 .. 3 ] );
- $version =~ s/,v\b//;
- $version =~ s/(\S+)$/($1)/;
- $version =~ tr%/%-%;
- print $version, "\n";
- exit;
-}
-my @modules;
-
-if ( -d '/etc/iptables.d' ) {
- @modules = </etc/iptables.d/*>;
-}
-
-# Concatenate everything together.
-my @data;
-push( @data, prefix() );
-push( @data, "\n" );
-for my $module (@modules) {
- push( @data, read_iptables($module) );
- push( @data, "\n" );
-}
-push( @data, suffix() );
-push( @data, snat() );
-
-if ( -f '/etc/debian_version' ) {
- install_debian(@data);
-} elsif ( -f '/etc/redhat-release' ) {
- install_redhat(@data);
-} else {
- die "$0: cannot figure out whether this is Red Hat or Debian\n";
-}
-
-exit 0;
-__END__
-
-##############################################################################
-# Documentation
-##############################################################################
-
-=head1 NAME
-
-rebuild-iptables - Construct an iptables rules file from fragments
-
-=head1 SYNOPSIS
-
-rebuild-iptables [B<-hv>]
-
-=head1 DESCRIPTION
-
-B<rebuild-iptables> constructs an iptables configuration file by concatenating
-various modules found in F</etc/iptables.d>. The resulting iptables
-configuration file is written to the appropriate file for either Red Hat or
-Debian (determined automatically) and iptables is restarted.
-
-Each module is just a text file located in the directory mentioned above that
-contains one or more iptables configuration lines (basically the arguments to
-an B<iptables> invocation), possibly including comments.
-
-Along with the modules in the directory specified, a standard prefix and suffix
-is added.
-
-Normally, the contents of each module are read in verbatim, but a module may