from-scratch 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.chef/knife.rb +6 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Berksfile +17 -0
- data/Berksfile.lock +19 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +58 -0
- data/Rakefile +6 -0
- data/Thorfile +5 -0
- data/bin/scratchify +6 -0
- data/chefignore +101 -0
- data/cookbooks/chef_gem/CHANGELOG.md +24 -0
- data/cookbooks/chef_gem/README.md +38 -0
- data/cookbooks/chef_gem/libraries/chef_gem.rb +72 -0
- data/cookbooks/chef_gem/metadata.json +29 -0
- data/cookbooks/chef_gem/recipes/default.rb +0 -0
- data/cookbooks/java/.gitignore +21 -0
- data/cookbooks/java/.kitchen.docker.yml +15 -0
- data/cookbooks/java/.kitchen.yml +126 -0
- data/cookbooks/java/.travis.yml +6 -0
- data/cookbooks/java/Berksfile +10 -0
- data/cookbooks/java/CHANGELOG.md +398 -0
- data/cookbooks/java/CONTRIBUTING.md +12 -0
- data/cookbooks/java/Gemfile +15 -0
- data/cookbooks/java/ISSUES.md +43 -0
- data/cookbooks/java/LICENSE +201 -0
- data/cookbooks/java/README.md +402 -0
- data/cookbooks/java/Rakefile +60 -0
- data/cookbooks/java/TESTING.md +41 -0
- data/cookbooks/java/attributes/default.rb +146 -0
- data/cookbooks/java/libraries/helpers.rb +120 -0
- data/cookbooks/java/libraries/matchers.rb +5 -0
- data/cookbooks/java/metadata.json +69 -0
- data/cookbooks/java/providers/alternatives.rb +94 -0
- data/cookbooks/java/providers/ark.rb +255 -0
- data/cookbooks/java/recipes/default.rb +22 -0
- data/cookbooks/java/recipes/default_java_symlink.rb +19 -0
- data/cookbooks/java/recipes/homebrew.rb +3 -0
- data/cookbooks/java/recipes/ibm.rb +76 -0
- data/cookbooks/java/recipes/ibm_tar.rb +70 -0
- data/cookbooks/java/recipes/openjdk.rb +74 -0
- data/cookbooks/java/recipes/oracle.rb +74 -0
- data/cookbooks/java/recipes/oracle_i386.rb +73 -0
- data/cookbooks/java/recipes/oracle_jce.rb +75 -0
- data/cookbooks/java/recipes/oracle_rpm.rb +60 -0
- data/cookbooks/java/recipes/purge_packages.rb +20 -0
- data/cookbooks/java/recipes/set_attributes_from_version.rb +55 -0
- data/cookbooks/java/recipes/set_java_home.rb +44 -0
- data/cookbooks/java/recipes/windows.rb +82 -0
- data/cookbooks/java/resources/alternatives.rb +30 -0
- data/cookbooks/java/resources/ark.rb +58 -0
- data/cookbooks/java/templates/default/ibm_jdk.installer.properties.erb +3 -0
- data/cookbooks/java/templates/default/oracle.jinfo.erb +6 -0
- data/cookbooks/rvm/.foodcritic +1 -0
- data/cookbooks/rvm/.gitignore +7 -0
- data/cookbooks/rvm/.kitchen.yml +66 -0
- data/cookbooks/rvm/.travis.yml +9 -0
- data/cookbooks/rvm/Berksfile +10 -0
- data/cookbooks/rvm/CHANGELOG.md +253 -0
- data/cookbooks/rvm/CODE_OF_CONDUCT.md +12 -0
- data/cookbooks/rvm/CONTRIBUTING.md +26 -0
- data/cookbooks/rvm/Gemfile +20 -0
- data/cookbooks/rvm/Guardfile +12 -0
- data/cookbooks/rvm/README.md +1459 -0
- data/cookbooks/rvm/Rakefile +18 -0
- data/cookbooks/rvm/attributes/.gitkeep +0 -0
- data/cookbooks/rvm/attributes/default.rb +68 -0
- data/cookbooks/rvm/attributes/gem_package.rb +23 -0
- data/cookbooks/rvm/attributes/vagrant.rb +23 -0
- data/cookbooks/rvm/libraries/chef_rvm_environment_helpers.rb +55 -0
- data/cookbooks/rvm/libraries/chef_rvm_gemset_helpers.rb +67 -0
- data/cookbooks/rvm/libraries/chef_rvm_recipe_helpers.rb +80 -0
- data/cookbooks/rvm/libraries/chef_rvm_ruby_helpers.rb +95 -0
- data/cookbooks/rvm/libraries/chef_rvm_set_helpers.rb +16 -0
- data/cookbooks/rvm/libraries/chef_rvm_shell_helpers.rb +57 -0
- data/cookbooks/rvm/libraries/chef_rvm_string_cache.rb +104 -0
- data/cookbooks/rvm/libraries/chef_rvm_string_helpers.rb +61 -0
- data/cookbooks/rvm/libraries/chef_rvm_version_helpers.rb +45 -0
- data/cookbooks/rvm/libraries/gem_package_monkeypatch.rb +34 -0
- data/cookbooks/rvm/libraries/provider_rvm_installation.rb +185 -0
- data/cookbooks/rvm/libraries/resource_rvm_installation.rb +103 -0
- data/cookbooks/rvm/libraries/rvm_chef_user_environment.rb +55 -0
- data/cookbooks/rvm/libraries/rvm_rubygems_package.rb +189 -0
- data/cookbooks/rvm/libraries/rvm_shell_chef_wrapper.rb +99 -0
- data/cookbooks/rvm/metadata.json +51 -0
- data/cookbooks/rvm/providers/default_ruby.rb +63 -0
- data/cookbooks/rvm/providers/environment.rb +78 -0
- data/cookbooks/rvm/providers/gemset.rb +118 -0
- data/cookbooks/rvm/providers/global_gem.rb +97 -0
- data/cookbooks/rvm/providers/ruby.rb +178 -0
- data/cookbooks/rvm/providers/shell.rb +121 -0
- data/cookbooks/rvm/providers/wrapper.rb +73 -0
- data/cookbooks/rvm/recipes/.gitkeep +0 -0
- data/cookbooks/rvm/recipes/default.rb +40 -0
- data/cookbooks/rvm/recipes/gem_package.rb +33 -0
- data/cookbooks/rvm/recipes/system.rb +37 -0
- data/cookbooks/rvm/recipes/system_install.rb +42 -0
- data/cookbooks/rvm/recipes/user.rb +43 -0
- data/cookbooks/rvm/recipes/user_install.rb +58 -0
- data/cookbooks/rvm/recipes/vagrant.rb +37 -0
- data/cookbooks/rvm/resources/default_ruby.rb +31 -0
- data/cookbooks/rvm/resources/environment.rb +31 -0
- data/cookbooks/rvm/resources/gem.rb +37 -0
- data/cookbooks/rvm/resources/gemset.rb +32 -0
- data/cookbooks/rvm/resources/global_gem.rb +34 -0
- data/cookbooks/rvm/resources/ruby.rb +32 -0
- data/cookbooks/rvm/resources/shell.rb +41 -0
- data/cookbooks/rvm/resources/wrapper.rb +34 -0
- data/cookbooks/rvm/templates/default/rvmrc.erb +14 -0
- data/cookbooks/rvm/templates/default/vagrant-chef-client-wrapper.erb +23 -0
- data/cookbooks/rvm/templates/default/vagrant-chef-solo-wrapper.erb +23 -0
- data/cookbooks/rvm/test/integration/data_bags/users/virgil1.json +4 -0
- data/cookbooks/rvm/test/integration/data_bags/users/virgil2.json +4 -0
- data/cookbooks/rvm/test/integration/data_bags/users/wigglebottom.json +3 -0
- data/cookbooks/rvm/test/integration/installs/bats/version_pinning.bats +13 -0
- data/cookbooks/rvm/test/integration/rubies/bats/_common.bash +16 -0
- data/cookbooks/rvm/test/integration/rubies/bats/verify_1.9.3.bats +9 -0
- data/cookbooks/rvm/test/integration/rubies/bats/verify_jruby.bats +12 -0
- data/cookbooks/rvm/test/integration/rubies/bats/verify_patch_support.bats +19 -0
- data/cookbooks/rvm/test/integration/rubies/bats/verify_ree.bats +9 -0
- data/cookbooks/rvm/test/integration/rubies/bats/verify_rubygems_version_support.bats +15 -0
- data/cookbooks/rvm/test/integration/stock_system_and_user/bats/system.bats +45 -0
- data/cookbooks/rvm/test/unit/libraries/provider_rvm_installation_spec.rb +220 -0
- data/cookbooks/rvm/test/unit/libraries/resource_rvm_installation_spec.rb +139 -0
- data/cookbooks/rvm/test/unit/spec_helper.rb +23 -0
- data/cookbooks/scratchify/.chef/knife.rb +9 -0
- data/cookbooks/scratchify/Berksfile +16 -0
- data/cookbooks/scratchify/Berksfile.lock +19 -0
- data/cookbooks/scratchify/LICENSE.txt +21 -0
- data/cookbooks/scratchify/README.md +41 -0
- data/cookbooks/scratchify/Thorfile +5 -0
- data/cookbooks/scratchify/bin/console +14 -0
- data/cookbooks/scratchify/bin/scratchify +6 -0
- data/cookbooks/scratchify/bin/setup +7 -0
- data/cookbooks/scratchify/chefignore +101 -0
- data/cookbooks/scratchify/data_bags/users/deploy.json +6 -0
- data/cookbooks/scratchify/environments/.gitkeep +0 -0
- data/cookbooks/scratchify/from-scratch.gemspec +36 -0
- data/cookbooks/scratchify/lib/from/scratch.rb +31 -0
- data/cookbooks/scratchify/lib/from/scratch/interviewer.rb +35 -0
- data/cookbooks/scratchify/lib/from/scratch/version.rb +3 -0
- data/cookbooks/scratchify/metadata.json +36 -0
- data/cookbooks/scratchify/nodes/normfood.ru.json +75 -0
- data/cookbooks/scratchify/recipes/default.rb +0 -0
- data/cookbooks/scratchify/roles/.gitkeep +0 -0
- data/cookbooks/scratchify/spec/from/scratch_spec.rb +11 -0
- data/cookbooks/scratchify/spec/spec_helper.rb +2 -0
- data/cookbooks/user/.gitignore +5 -0
- data/cookbooks/user/.kitchen.yml +46 -0
- data/cookbooks/user/.travis.yml +4 -0
- data/cookbooks/user/Berksfile +7 -0
- data/cookbooks/user/CHANGELOG.md +101 -0
- data/cookbooks/user/Gemfile +14 -0
- data/cookbooks/user/README.md +447 -0
- data/cookbooks/user/Rakefile +21 -0
- data/cookbooks/user/attributes/default.rb +50 -0
- data/cookbooks/user/libraries/matchers.rb +26 -0
- data/cookbooks/user/metadata.json +46 -0
- data/cookbooks/user/providers/account.rb +212 -0
- data/cookbooks/user/recipes/data_bag.rb +59 -0
- data/cookbooks/user/recipes/default.rb +18 -0
- data/cookbooks/user/resources/account.rb +41 -0
- data/cookbooks/user/templates/default/authorized_keys.erb +7 -0
- data/from-scratch.gemspec +33 -0
- data/lib/from-scratch.rb +25 -0
- data/lib/from-scratch/version.rb +3 -0
- data/metadata.rb +15 -0
- data/recipes/default.rb +0 -0
- data/templates/node.json.erb +31 -0
- data/templates/user.json.erb +6 -0
- metadata +330 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: rvm
|
|
3
|
+
# Recipe:: vagrant
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2011, Fletcher Nichol
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
template "/usr/local/bin/chef-client" do
|
|
21
|
+
source "vagrant-chef-client-wrapper.erb"
|
|
22
|
+
owner "root"
|
|
23
|
+
group "root"
|
|
24
|
+
mode "0755"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
template "/usr/local/bin/chef-solo" do
|
|
28
|
+
source "vagrant-chef-solo-wrapper.erb"
|
|
29
|
+
owner "root"
|
|
30
|
+
group "root"
|
|
31
|
+
mode "0755"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
group "rvm" do
|
|
35
|
+
members ["vagrant"]
|
|
36
|
+
append true
|
|
37
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: rvm
|
|
3
|
+
# Resource:: default_ruby
|
|
4
|
+
#
|
|
5
|
+
# Author:: Fletcher Nichol <fnichol@nichol.ca>
|
|
6
|
+
#
|
|
7
|
+
# Copyright 2011, Fletcher Nichol
|
|
8
|
+
#
|
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
# you may not use this file except in compliance with the License.
|
|
11
|
+
# You may obtain a copy of the License at
|
|
12
|
+
#
|
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
#
|
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
# See the License for the specific language governing permissions and
|
|
19
|
+
# limitations under the License.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
actions :create
|
|
23
|
+
|
|
24
|
+
attribute :ruby_string, :kind_of => String, :name_attribute => true
|
|
25
|
+
attribute :user, :kind_of => String
|
|
26
|
+
attribute :patch, :kind_of => String
|
|
27
|
+
|
|
28
|
+
def initialize(*args)
|
|
29
|
+
super
|
|
30
|
+
@action = :create
|
|
31
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: rvm
|
|
3
|
+
# Resource:: environment
|
|
4
|
+
#
|
|
5
|
+
# Author:: Fletcher Nichol <fnichol@nichol.ca>
|
|
6
|
+
#
|
|
7
|
+
# Copyright 2011, Fletcher Nichol
|
|
8
|
+
#
|
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
# you may not use this file except in compliance with the License.
|
|
11
|
+
# You may obtain a copy of the License at
|
|
12
|
+
#
|
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
#
|
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
# See the License for the specific language governing permissions and
|
|
19
|
+
# limitations under the License.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
actions :create
|
|
23
|
+
|
|
24
|
+
attribute :ruby_string, :kind_of => String, :name_attribute => true
|
|
25
|
+
attribute :user, :kind_of => String
|
|
26
|
+
attribute :patch, :kind_of => String
|
|
27
|
+
|
|
28
|
+
def initialize(*args)
|
|
29
|
+
super
|
|
30
|
+
@action = :create
|
|
31
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: rvm
|
|
3
|
+
# Resource:: gem
|
|
4
|
+
#
|
|
5
|
+
# Author:: Fletcher Nichol <fnichol@nichol.ca>
|
|
6
|
+
#
|
|
7
|
+
# Copyright 2011, Fletcher Nichol
|
|
8
|
+
#
|
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
# you may not use this file except in compliance with the License.
|
|
11
|
+
# You may obtain a copy of the License at
|
|
12
|
+
#
|
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
#
|
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
# See the License for the specific language governing permissions and
|
|
19
|
+
# limitations under the License.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
actions :install, :upgrade, :remove, :purge
|
|
23
|
+
|
|
24
|
+
attribute :package_name, :kind_of => String, :name_attribute => true
|
|
25
|
+
attribute :version, :kind_of => String
|
|
26
|
+
attribute :ruby_string, :kind_of => String, :default => "default"
|
|
27
|
+
attribute :response_file, :kind_of => String
|
|
28
|
+
attribute :source, :kind_of => String
|
|
29
|
+
attribute :options, :kind_of => Hash
|
|
30
|
+
attribute :gem_binary, :kind_of => String
|
|
31
|
+
attribute :user, :kind_of => String
|
|
32
|
+
|
|
33
|
+
def initialize(*args)
|
|
34
|
+
super
|
|
35
|
+
@action = :install
|
|
36
|
+
@provider = Chef::Provider::Package::RVMRubygems
|
|
37
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: rvm
|
|
3
|
+
# Resource:: gemset
|
|
4
|
+
#
|
|
5
|
+
# Author:: Fletcher Nichol <fnichol@nichol.ca>
|
|
6
|
+
#
|
|
7
|
+
# Copyright 2011, Fletcher Nichol
|
|
8
|
+
#
|
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
# you may not use this file except in compliance with the License.
|
|
11
|
+
# You may obtain a copy of the License at
|
|
12
|
+
#
|
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
#
|
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
# See the License for the specific language governing permissions and
|
|
19
|
+
# limitations under the License.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
actions :create, :delete, :empty, :update
|
|
23
|
+
|
|
24
|
+
attribute :gemset, :kind_of => String, :name_attribute => true
|
|
25
|
+
attribute :ruby_string, :kind_of => String, :regex => /^[^@]+$/
|
|
26
|
+
attribute :user, :kind_of => String
|
|
27
|
+
attribute :patch, :kind_of => String
|
|
28
|
+
|
|
29
|
+
def initialize(*args)
|
|
30
|
+
super
|
|
31
|
+
@action = :create
|
|
32
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: rvm
|
|
3
|
+
# Resource:: global_gem
|
|
4
|
+
#
|
|
5
|
+
# Author:: Fletcher Nichol <fnichol@nichol.ca>
|
|
6
|
+
#
|
|
7
|
+
# Copyright 2011, Fletcher Nichol
|
|
8
|
+
#
|
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
# you may not use this file except in compliance with the License.
|
|
11
|
+
# You may obtain a copy of the License at
|
|
12
|
+
#
|
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
#
|
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
# See the License for the specific language governing permissions and
|
|
19
|
+
# limitations under the License.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
actions :install, :upgrade, :remove, :purge
|
|
23
|
+
|
|
24
|
+
attribute :package_name, :kind_of => String, :name_attribute => true
|
|
25
|
+
attribute :version, :kind_of => String
|
|
26
|
+
attribute :source, :kind_of => String
|
|
27
|
+
attribute :options, :kind_of => Hash
|
|
28
|
+
attribute :gem_binary, :kind_of => String
|
|
29
|
+
attribute :user, :kind_of => String
|
|
30
|
+
|
|
31
|
+
def initialize(*args)
|
|
32
|
+
super
|
|
33
|
+
@action = :install
|
|
34
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: rvm
|
|
3
|
+
# Resource:: ruby
|
|
4
|
+
#
|
|
5
|
+
# Author:: Fletcher Nichol <fnichol@nichol.ca>
|
|
6
|
+
#
|
|
7
|
+
# Copyright 2011, Fletcher Nichol
|
|
8
|
+
#
|
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
# you may not use this file except in compliance with the License.
|
|
11
|
+
# You may obtain a copy of the License at
|
|
12
|
+
#
|
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
#
|
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
# See the License for the specific language governing permissions and
|
|
19
|
+
# limitations under the License.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
actions :install, :uninstall, :remove
|
|
23
|
+
|
|
24
|
+
attribute :ruby_string, :kind_of => String, :name_attribute => true
|
|
25
|
+
attribute :user, :kind_of => String
|
|
26
|
+
attribute :patch, :kind_of => String
|
|
27
|
+
attribute :rubygems_version, :kind_of => String
|
|
28
|
+
|
|
29
|
+
def initialize(*args)
|
|
30
|
+
super
|
|
31
|
+
@action = :install
|
|
32
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: rvm
|
|
3
|
+
# Resource:: shell
|
|
4
|
+
#
|
|
5
|
+
# Author:: Fletcher Nichol <fnichol@nichol.ca>
|
|
6
|
+
#
|
|
7
|
+
# Copyright 2011, Fletcher Nichol
|
|
8
|
+
#
|
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
# you may not use this file except in compliance with the License.
|
|
11
|
+
# You may obtain a copy of the License at
|
|
12
|
+
#
|
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
#
|
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
# See the License for the specific language governing permissions and
|
|
19
|
+
# limitations under the License.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
actions :run
|
|
23
|
+
|
|
24
|
+
attribute :name, :kind_of => String, :name_attribute => true
|
|
25
|
+
attribute :ruby_string, :kind_of => String, :default => "default"
|
|
26
|
+
attribute :code, :kind_of => String
|
|
27
|
+
attribute :creates, :kind_of => String
|
|
28
|
+
attribute :cwd, :kind_of => String
|
|
29
|
+
attribute :environment, :kind_of => Hash
|
|
30
|
+
attribute :group, :kind_of => String
|
|
31
|
+
attribute :path, :kind_of => Array
|
|
32
|
+
attribute :returns, :kind_of => Array, :default => [ 0 ]
|
|
33
|
+
attribute :timeout, :kind_of => Integer
|
|
34
|
+
attribute :user, :kind_of => String
|
|
35
|
+
attribute :umask, :kind_of => String
|
|
36
|
+
attribute :patch, :kind_of => String
|
|
37
|
+
|
|
38
|
+
def initialize(*args)
|
|
39
|
+
super
|
|
40
|
+
@action = :run
|
|
41
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: rvm
|
|
3
|
+
# Resource:: wrapper
|
|
4
|
+
#
|
|
5
|
+
# Author:: Fletcher Nichol <fnichol@nichol.ca>
|
|
6
|
+
#
|
|
7
|
+
# Copyright 2011, Fletcher Nichol
|
|
8
|
+
#
|
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
# you may not use this file except in compliance with the License.
|
|
11
|
+
# You may obtain a copy of the License at
|
|
12
|
+
#
|
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
#
|
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
# See the License for the specific language governing permissions and
|
|
19
|
+
# limitations under the License.
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
actions :create
|
|
23
|
+
|
|
24
|
+
attribute :prefix, :kind_of => String, :name_attribute => true
|
|
25
|
+
attribute :ruby_string, :kind_of => String
|
|
26
|
+
attribute :binary, :kind_of => String
|
|
27
|
+
attribute :binaries, :kind_of => Array
|
|
28
|
+
attribute :user, :kind_of => String
|
|
29
|
+
attribute :patch, :kind_of => String
|
|
30
|
+
|
|
31
|
+
def initialize(*args)
|
|
32
|
+
super
|
|
33
|
+
@action = :create
|
|
34
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# rvm configuration
|
|
2
|
+
#
|
|
3
|
+
# Generated by Chef for <%= @user %>@<%= node['fqdn'] %>
|
|
4
|
+
# Local modifications will be overwritten.
|
|
5
|
+
#
|
|
6
|
+
<% if @user == "root" -%>
|
|
7
|
+
umask u=rwx,g=rwx,o=rx
|
|
8
|
+
<% end -%>
|
|
9
|
+
export rvm_path="<%= @rvm_path %>"
|
|
10
|
+
|
|
11
|
+
<% @rvmrc_env.each_pair do |k,v| -%>
|
|
12
|
+
<% next unless v -%>
|
|
13
|
+
export <%= k %>="<%= v %>"
|
|
14
|
+
<% end -%>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# RVM-aware chef-client wrapper
|
|
4
|
+
#
|
|
5
|
+
# Generated by Chef for <%= node['fqdn'] %>
|
|
6
|
+
# Local modifications will be overridden
|
|
7
|
+
|
|
8
|
+
if [[ -d "<%= node['rvm']['root_path'] %>" ]] ; then
|
|
9
|
+
export PATH="/bin:<%= node['rvm']['root_path'] %>:$PATH"
|
|
10
|
+
rvm_path='<%= node['rvm']['root_path'] %>'
|
|
11
|
+
export rvm_path
|
|
12
|
+
unset RUBY_VERSION
|
|
13
|
+
unset GEM_HOME
|
|
14
|
+
unset GEM_PATH
|
|
15
|
+
unset MY_RUBY_HOME
|
|
16
|
+
unset IRBRC
|
|
17
|
+
rvm_ruby_string='system'
|
|
18
|
+
export rvm_ruby_string
|
|
19
|
+
unset rvm_gemset_name
|
|
20
|
+
unset MAGLEV_HOME
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
exec <%= node['rvm']['vagrant']['system_chef_client'] %> "$@"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# RVM-aware chef-solo wrapper
|
|
4
|
+
#
|
|
5
|
+
# Generated by Chef for <%= node['fqdn'] %>
|
|
6
|
+
# Local modifications will be overridden
|
|
7
|
+
|
|
8
|
+
if [[ -d "<%= node['rvm']['root_path'] %>" ]] ; then
|
|
9
|
+
export PATH="/bin:<%= node['rvm']['root_path'] %>:$PATH"
|
|
10
|
+
rvm_path='<%= node['rvm']['root_path'] %>'
|
|
11
|
+
export rvm_path
|
|
12
|
+
unset RUBY_VERSION
|
|
13
|
+
unset GEM_HOME
|
|
14
|
+
unset GEM_PATH
|
|
15
|
+
unset MY_RUBY_HOME
|
|
16
|
+
unset IRBRC
|
|
17
|
+
rvm_ruby_string='system'
|
|
18
|
+
export rvm_ruby_string
|
|
19
|
+
unset rvm_gemset_name
|
|
20
|
+
unset MAGLEV_HOME
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
exec <%= node['rvm']['vagrant']['system_chef_solo'] %> "$@"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bats
|
|
2
|
+
|
|
3
|
+
@test "virgil1 user has rvm-1.19.6" {
|
|
4
|
+
run sudo -u virgil1 -i rvm version
|
|
5
|
+
[ $status -eq 0 ]
|
|
6
|
+
[ "$(echo $output | awk '{print $2}')" = "1.19.6" ]
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@test "virgil2 user has rvm-1.21.20" {
|
|
10
|
+
run sudo -u virgil2 -i rvm version
|
|
11
|
+
[ $status -eq 0 ]
|
|
12
|
+
[ "$(echo $output | awk '{print $2}')" = "1.21.20" ]
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
setup() {
|
|
2
|
+
source /etc/profile.d/rvm.sh
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
run_nokogiri_openssl_test() {
|
|
6
|
+
local rubie="$1"
|
|
7
|
+
local https_url="https://google.com"
|
|
8
|
+
local requires="require 'nokogiri';"
|
|
9
|
+
local script="$requires puts Nokogiri::HTML(open('$https_url')).css('input')"
|
|
10
|
+
|
|
11
|
+
run rvm $rubie do gem install nokogiri --no-ri --no-rdoc
|
|
12
|
+
[ "$status" -eq 0 ]
|
|
13
|
+
|
|
14
|
+
run rvm $rubie do ruby -rrubygems -ropen-uri -e "$script"
|
|
15
|
+
[ "$status" -eq 0 ]
|
|
16
|
+
}
|