This repository has been archived by the owner on Jun 18, 2019. It is now read-only.
/
bundle_install.rb
102 lines (84 loc) · 2.01 KB
/
bundle_install.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
ruby_runtime 'bundle_install test' do
version ''
provider :system
end
directory '/opt/bundle1'
file '/opt/bundle1/Gemfile' do
content <<-EOH
source 'https://rubygems.org/'
gem 'rake'
EOH
end
bundle_install '/opt/bundle1/Gemfile'
# Nuke it if needed, tests for notifications require starting from scratch
execute 'rm -rf /opt/bundle2' if File.exists?('/opt/bundle2')
directory '/opt/bundle2'
file '/opt/bundle2/Gemfile' do
content <<-EOH
source 'https://rubygems.org/'
gem 'rake'
EOH
end
file '/opt/bundle2/Gemfile.lock' do
content <<-EOH
GEM
remote: https://rubygems.org/
specs:
rake (10.4.2)
PLATFORMS
ruby
DEPENDENCIES
rake
EOH
end
file '/opt/bundle2/sentinel1' do
action :nothing
content ''
end
bundle_install '/opt/bundle2/Gemfile' do
deployment true
binstubs true
notifies :create, 'file[/opt/bundle2/sentinel1]', :immediately
end
file '/opt/bundle2/sentinel2' do
action :nothing
content ''
end
bundle_install '/opt/bundle2/Gemfile again' do
path '/opt/bundle2/Gemfile'
deployment true
binstubs true
notifies :create, 'file[/opt/bundle2/sentinel2]', :immediately
end
if platform_family?('rhel')
ruby_runtime 'bundle_install test scl' do
version ''
provider :scl
end
directory '/opt/bundle3'
file '/opt/bundle3/Gemfile' do
content <<-EOH
source 'https://rubygems.org/'
gem 'rake'
EOH
end
bundle_install '/opt/bundle3/Gemfile' do
ruby 'bundle_install test scl'
binstubs true
end
end