builderator 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1165e5306fde1228d9bca1afa98531042ef08d29
4
- data.tar.gz: b31a626d1c14bbc717022174b1cfa802c4caa222
3
+ metadata.gz: c50ce622dec2d73dd13406c3b941149298d271cf
4
+ data.tar.gz: 6d021cc692497f5572185ca42852cb7f6afe8fee
5
5
  SHA512:
6
- metadata.gz: bdd44c1a386da6ae63c130828443c7140a56b404eaa10e034267e9ae43eac8d7b9e88a8802aa7655698333b8c38b5c3eb8c902518afabfb3a3c50909729f3948
7
- data.tar.gz: a5fa532a17692961048d13695465e4ffa09e5214fbdce58014ed678fc10785202ab4aef90095168a09e69959e23f9328fcbb030ce7b3ebdd37c2a6c02c9c25c8
6
+ metadata.gz: 7989a99fdf08aaf981be134f963ab43884dec0864e95f8a5c0016b644211bbbf112561281ddc26ca88a57d7a081b7c8e0fc71f0c9dca6239ff0d610901c4fdce
7
+ data.tar.gz: a3c5d7ac1514f5af7d6d84d5b37f4a3a2e464b75b04281a2000794b7222bd952282f9d69810ab63ec671e73db6250be49964b0d08621aaefb3bac750c4dfd11c
data/Gemfile.lock CHANGED
@@ -4,6 +4,7 @@ PATH
4
4
  builderator (0.0.1)
5
5
  aws-sdk (~> 2.0)
6
6
  berkshelf (~> 4.3)
7
+ chef (~> 12.5)
7
8
  dep_selector (~> 1.0)
8
9
  faraday_middleware (~> 0.10.0)
9
10
  ignorefile
@@ -49,15 +50,45 @@ GEM
49
50
  buff-ruby_engine (0.1.0)
50
51
  buff-shell_out (0.2.0)
51
52
  buff-ruby_engine (~> 0.1.0)
53
+ builder (3.2.2)
52
54
  celluloid (0.16.0)
53
55
  timers (~> 4.0.0)
54
56
  celluloid-io (0.16.2)
55
57
  celluloid (>= 0.16.0)
56
58
  nio4r (>= 1.1.0)
57
- chef-config (12.9.38)
58
- fuzzyurl (~> 0.8.0)
59
+ chef (12.7.2)
60
+ chef-config (= 12.7.2)
61
+ chef-zero (~> 4.5)
62
+ diff-lcs (~> 1.2, >= 1.2.4)
63
+ erubis (~> 2.7)
64
+ ffi-yajl (~> 2.2)
65
+ highline (~> 1.6, >= 1.6.9)
66
+ mixlib-authentication (~> 1.4)
67
+ mixlib-cli (~> 1.4)
68
+ mixlib-log (~> 1.3)
69
+ mixlib-shellout (~> 2.0)
70
+ net-ssh (>= 2.9, < 4.0)
71
+ net-ssh-multi (~> 1.1)
72
+ ohai (>= 8.6.0.alpha.1, < 9)
73
+ plist (~> 3.1.0)
74
+ proxifier (~> 1.0)
75
+ rspec-core (~> 3.4)
76
+ rspec-expectations (~> 3.4)
77
+ rspec-mocks (~> 3.4)
78
+ rspec_junit_formatter (~> 0.2.0)
79
+ serverspec (~> 2.7)
80
+ specinfra (~> 2.10)
81
+ syslog-logger (~> 1.6)
82
+ uuidtools (~> 2.1.5)
83
+ chef-config (12.7.2)
59
84
  mixlib-config (~> 2.0)
60
85
  mixlib-shellout (~> 2.0)
86
+ chef-zero (4.6.1)
87
+ ffi-yajl (~> 2.2)
88
+ hashie (>= 2.0, < 4.0)
89
+ mixlib-log (~> 1.3)
90
+ rack
91
+ uuidtools (~> 2.1)
61
92
  cleanroom (1.0.0)
62
93
  dep-selector-libgecode (1.2.0)
63
94
  dep_selector (1.0.3)
@@ -70,32 +101,62 @@ GEM
70
101
  faraday_middleware (0.10.0)
71
102
  faraday (>= 0.7.4, < 0.10)
72
103
  ffi (1.9.10)
73
- fuzzyurl (0.8.0)
104
+ ffi-yajl (2.2.3)
105
+ libyajl2 (~> 1.2)
74
106
  hashie (3.4.3)
107
+ highline (1.7.8)
75
108
  hitimes (1.2.3)
76
109
  httpclient (2.7.1)
77
110
  ignorefile (1.1.0)
111
+ ipaddress (0.8.3)
78
112
  jmespath (1.2.4)
79
113
  json_pure (>= 1.8.1)
80
114
  json (1.8.3)
81
115
  json_pure (1.8.3)
116
+ libyajl2 (1.2.0)
82
117
  minitar (0.5.4)
83
118
  mixlib-authentication (1.4.0)
84
119
  mixlib-log
85
120
  rspec-core (~> 3.2)
86
121
  rspec-expectations (~> 3.2)
87
122
  rspec-mocks (~> 3.2)
123
+ mixlib-cli (1.5.0)
88
124
  mixlib-config (2.2.1)
89
125
  mixlib-log (1.6.0)
90
126
  mixlib-shellout (2.2.6)
91
127
  molinillo (0.4.4)
128
+ multi_json (1.11.2)
92
129
  multipart-post (2.0.0)
130
+ net-scp (1.2.1)
131
+ net-ssh (>= 2.6.5)
132
+ net-ssh (3.1.1)
133
+ net-ssh-gateway (1.2.0)
134
+ net-ssh (>= 2.6.5)
135
+ net-ssh-multi (1.2.1)
136
+ net-ssh (>= 2.6.5)
137
+ net-ssh-gateway (>= 1.2.0)
138
+ net-telnet (0.1.1)
93
139
  nio4r (1.2.1)
94
140
  octokit (4.3.0)
95
141
  sawyer (~> 0.7.0, >= 0.5.3)
142
+ ohai (8.15.1)
143
+ chef-config (>= 12.5.0.alpha.1, < 13)
144
+ ffi (~> 1.9)
145
+ ffi-yajl (~> 2.2)
146
+ ipaddress
147
+ mixlib-cli
148
+ mixlib-config (~> 2.0)
149
+ mixlib-log
150
+ mixlib-shellout (~> 2.0)
151
+ plist (~> 3.1)
152
+ systemu (~> 2.6.4)
153
+ wmi-lite (~> 1.0)
96
154
  parser (2.3.0.7)
97
155
  ast (~> 2.2)
156
+ plist (3.1.0)
98
157
  powerpack (0.1.1)
158
+ proxifier (1.0.3)
159
+ rack (1.6.4)
99
160
  rainbow (2.1.0)
100
161
  rake (10.5.0)
101
162
  retryable (2.0.3)
@@ -126,10 +187,16 @@ GEM
126
187
  rspec-expectations (3.4.0)
127
188
  diff-lcs (>= 1.2.0, < 2.0)
128
189
  rspec-support (~> 3.4.0)
190
+ rspec-its (1.2.0)
191
+ rspec-core (>= 3.0.0)
192
+ rspec-expectations (>= 3.0.0)
129
193
  rspec-mocks (3.4.1)
130
194
  diff-lcs (>= 1.2.0, < 2.0)
131
195
  rspec-support (~> 3.4.0)
132
196
  rspec-support (3.4.1)
197
+ rspec_junit_formatter (0.2.3)
198
+ builder (< 4)
199
+ rspec-core (>= 2, < 4, != 2.12.0)
133
200
  rubocop (0.39.0)
134
201
  parser (>= 2.3.0.7, < 3.0)
135
202
  powerpack (~> 0.1)
@@ -141,9 +208,22 @@ GEM
141
208
  addressable (>= 2.3.5, < 2.5)
142
209
  faraday (~> 0.8, < 0.10)
143
210
  semverse (1.2.1)
211
+ serverspec (2.31.1)
212
+ multi_json
213
+ rspec (~> 3.0)
214
+ rspec-its
215
+ specinfra (~> 2.53)
216
+ sfl (2.2)
144
217
  solve (2.0.3)
145
218
  molinillo (~> 0.4.2)
146
219
  semverse (~> 1.1)
220
+ specinfra (2.56.1)
221
+ net-scp
222
+ net-ssh (>= 2.7, < 4.0)
223
+ net-telnet
224
+ sfl
225
+ syslog-logger (1.6.8)
226
+ systemu (2.6.5)
147
227
  thor (0.19.1)
148
228
  thor-scmversion (1.7.0)
149
229
  mixlib-shellout
@@ -151,9 +231,11 @@ GEM
151
231
  timers (4.0.4)
152
232
  hitimes
153
233
  unicode-display_width (1.0.3)
234
+ uuidtools (2.1.5)
154
235
  varia_model (0.4.1)
155
236
  buff-extensions (~> 1.0)
156
237
  hashie (>= 2.0.2, < 4.0.0)
238
+ wmi-lite (1.0.0)
157
239
 
158
240
  PLATFORMS
159
241
  ruby
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
data/builderator.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency 'aws-sdk', '~> 2.0'
27
27
  spec.add_dependency 'berkshelf', '~> 4.3'
28
28
  spec.add_dependency 'dep_selector', '~> 1.0'
29
- # spec.add_dependency 'chef', '~> 12.5'
29
+ spec.add_dependency 'chef', '~> 12.5'
30
30
  spec.add_dependency 'faraday_middleware', '~> 0.10.0'
31
31
  spec.add_dependency 'ignorefile'
32
32
  spec.add_dependency 'thor', '~> 0.19.0'
@@ -17,3 +17,11 @@ Collection of declared cookbook dependencies. Options are passed to [Berkshelf](
17
17
  * `ref` A comittish reference from which to fetch the cookbook
18
18
  * `rel` The sub-directory of a git repository to check out as a cookbook
19
19
  * `path` The path to a local cookbook, relative to the build workspace.
20
+
21
+ ## Tasks
22
+
23
+ * `berks metadata COOKBOOK` Generates a `metadata.json` file from a local cookbook's `metadata.rb` file. The specified `COOKBOOK` must be in the `cookbook.depends` collection with a valid `path` attribute.
24
+ * `berks vendor` Resolve and fetch cookbooks for the `cookbook.depends` collection and store in `$VENDOR_PATH/cookbooks`
25
+ * `berks upload` Upload the resolved dependency set for `cookbook.depends` to the Chef Server configured in Berkshelf's configuration (default `$HOME/.berkshelf/config.json`)
26
+ * `berks clean` Removes the project's cookbook vendor cache.
27
+ * `berks uncache` is a helper to clear Berkshelf's host-cache, in `$HOME/.berkshelf/cookbooks` by default.
@@ -1,3 +1,4 @@
1
+ require 'chef/cookbook/metadata'
1
2
  require 'thor'
2
3
 
3
4
  require_relative '../interface/berkshelf'
@@ -20,6 +21,20 @@ module Builderator
20
21
  Interface.berkshelf.write
21
22
  end
22
23
 
24
+ desc 'metadata COOKBOOK', 'Generate metadata.json from metadata.rb for a COOKBOOK that has a path'
25
+ def metadata(cookbook)
26
+ fail "Cookbook #{ cookbook } does not have a path!" unless Config.cookbook.depends.has?(cookbook) &&
27
+ !Config.cookbook.depends[cookbook].path.nil?
28
+
29
+ cookbook_path = Config.cookbook.depends[cookbook].path
30
+ metadata_rb = Chef::Cookbook::Metadata.new
31
+
32
+ metadata_rb.from_file(::File.join(cookbook_path, 'metadata.rb'))
33
+
34
+ say_status :metadata, "for cookbook #{ metadata_rb.name }@#{ metadata_rb.version }"
35
+ create_file ::File.join(cookbook_path, 'metadata.json'), metadata_rb.to_json, :force => true
36
+ end
37
+
23
38
  desc 'vendor', 'Vendor a cookbook release and its dependencies'
24
39
  def vendor
25
40
  invoke :configure, [], options
@@ -1,109 +1,109 @@
1
- require 'chef'
2
- require 'chef/cookbook_site_streaming_uploader'
3
- require 'rubygems/package'
4
- require 'thor'
5
- require 'thor/actions'
6
- require 'thor-scmversion'
7
- require 'zlib'
8
-
9
- require_relative '../util'
10
- require_relative '../util/cookbook'
11
-
12
- module Builderator
13
- module Tasks
14
- class Cookbook < Thor
15
- include Thor::Actions
16
- class_option :version, :type => :boolean,
17
- :default => true,
18
- :desc => 'Write current verison to file'
19
-
20
- desc 'metadata [PATH]', 'Use cookbook matadata file at PATH/metadata.rb to generate PATH/matadata.json'
21
- def metadata(cookbook = nil)
22
- Util::Cookbook.path(cookbook) unless cookbook.nil?
23
- metadata = Util::Cookbook.metadata
24
-
25
- invoke 'version:current', [], options if options['version']
26
- say_status :metadata, "for cookbook #{ metadata.name }@#{ metadata.version }"
27
- create_file Util::Cookbook.path.join('metadata.json').to_s, metadata.to_json, :force => true
28
-
29
- metadata
30
- end
31
-
32
- desc 'build PATH', 'Package cookbook at PATH into a tarball'
33
- def build(cookbook = nil)
34
- Util::Cookbook.path(cookbook) unless cookbook.nil?
35
-
36
- ## Generate metadata.json
37
- metadata = invoke(Tasks::Cookbook, :metadata, [], options)
38
-
39
- ## Create a gzipped tarball and add cookbook files to it. We avoid
40
- ## buffering this in memory (e.g. using StringIO) at all cost
41
- ## to keep large files from gumming things up.
42
- say_status :package, "cookbook into #{ metadata.archive }"
43
- metadata.archive.open('wb') do |package|
44
- Zlib::GzipWriter.wrap(package) do |gz|
45
- Gem::Package::TarWriter.new(gz) do |tar|
46
- metadata.files.each do |f|
47
- f_stat = File.stat(f)
48
-
49
- ## Add directories
50
- next tar.mkdir(Util::Cookbook.archive_path(metadata, f).to_s, f_stat.mode) if File.directory?(f)
51
-
52
- ## Add files
53
- tar.add_file_simple(Util::Cookbook.archive_path(metadata, f).to_s, f_stat.mode, f_stat.size) do |entry|
54
- f.open('rb') { |h| entry.write(h.read) }
55
- end
56
- end
57
- end
58
- end
59
- end
60
-
61
- metadata
62
- end
63
-
64
- desc 'push PATH', 'Publish cookbook at PATH to supermarket.chef.io'
65
- option 'chef-config', :type => :string,
66
- :aliases => :c,
67
- :default => File.join(ENV['HOME'], '.chef/knife.rb')
68
- option :site, :type => :string, :aliases => :s
69
- option :user, :type => :string, :aliases => :u
70
- option :key, :type => :string, :aliases => :k
71
- def push(cookbook = nil)
72
- Chef::Config.from_file(options['chef-config'])
73
- Util::Cookbook.path(cookbook) unless cookbook.nil?
74
-
75
- ## Set defaults after Chef::Config is loaded
76
- options['site'] ||= Chef::Config.knife['supermarket_site'] || 'https://supermarket.chef.io/'
77
- options['user'] ||= Chef::Config.knife['supermarket_user'] || Chef::Config.node_name
78
- options['key'] ||= Chef::Config.knife['supermarket_key'] || Chef::Config.client_key
79
-
80
- ## Build the cookbook taball
81
- metadata = invoke(Tasks::Cookbook, :build, [cookbook], options)
82
- say_status :upload, "cookbook #{ metadata.name }@#{ metadata.version } to #{ options['site'] }"
83
-
84
- metadata.archive.open('rb') do |c|
85
- http_resp = Chef::CookbookSiteStreamingUploader.post(
86
- File.join(options['site'], '/api/v1/cookbooks'),
87
- options['user'],
88
- options['key'],
89
- :tarball => c,
90
- :cookbook => { :category => '' }.to_json
91
- )
92
-
93
- if http_resp.code.to_i != 201
94
- say_status :error, "Error uploading cookbook: #{ http_resp.code } #{ http_resp.message }", :red
95
- say http_resp.body
96
- exit(1)
97
- end
98
- end
99
- end
100
-
101
- desc 'version COOKBOOK', 'Print the current version of a vendored cookbook'
102
- option :path, :default => Util::Cookbook::DEFAULT_VENDOR, :desc => 'Path to vendored cookbooks'
103
- def version(cookbook)
104
- Util::Cookbook.path(File.join(options['path'], cookbook))
105
- puts Util::Cookbook.metadata.version
106
- end
107
- end
108
- end
109
- end
1
+ # require 'chef'
2
+ # require 'chef/cookbook_site_streaming_uploader'
3
+ # require 'rubygems/package'
4
+ # require 'thor'
5
+ # require 'thor/actions'
6
+ # require 'thor-scmversion'
7
+ # require 'zlib'
8
+ #
9
+ # require_relative '../util'
10
+ # require_relative '../util/cookbook'
11
+ #
12
+ # module Builderator
13
+ # module Tasks
14
+ # class Cookbook < Thor
15
+ # include Thor::Actions
16
+ # class_option :version, :type => :boolean,
17
+ # :default => true,
18
+ # :desc => 'Write current verison to file'
19
+ #
20
+ # desc 'metadata [PATH]', 'Use cookbook matadata file at PATH/metadata.rb to generate PATH/matadata.json'
21
+ # def metadata(cookbook = nil)
22
+ # Util::Cookbook.path(cookbook) unless cookbook.nil?
23
+ # metadata = Util::Cookbook.metadata
24
+ #
25
+ # invoke 'version:current', [], options if options['version']
26
+ # say_status :metadata, "for cookbook #{ metadata.name }@#{ metadata.version }"
27
+ # create_file Util::Cookbook.path.join('metadata.json').to_s, metadata.to_json, :force => true
28
+ #
29
+ # metadata
30
+ # end
31
+ #
32
+ # desc 'build PATH', 'Package cookbook at PATH into a tarball'
33
+ # def build(cookbook = nil)
34
+ # Util::Cookbook.path(cookbook) unless cookbook.nil?
35
+ #
36
+ # ## Generate metadata.json
37
+ # metadata = invoke(Tasks::Cookbook, :metadata, [], options)
38
+ #
39
+ # ## Create a gzipped tarball and add cookbook files to it. We avoid
40
+ # ## buffering this in memory (e.g. using StringIO) at all cost
41
+ # ## to keep large files from gumming things up.
42
+ # say_status :package, "cookbook into #{ metadata.archive }"
43
+ # metadata.archive.open('wb') do |package|
44
+ # Zlib::GzipWriter.wrap(package) do |gz|
45
+ # Gem::Package::TarWriter.new(gz) do |tar|
46
+ # metadata.files.each do |f|
47
+ # f_stat = File.stat(f)
48
+ #
49
+ # ## Add directories
50
+ # next tar.mkdir(Util::Cookbook.archive_path(metadata, f).to_s, f_stat.mode) if File.directory?(f)
51
+ #
52
+ # ## Add files
53
+ # tar.add_file_simple(Util::Cookbook.archive_path(metadata, f).to_s, f_stat.mode, f_stat.size) do |entry|
54
+ # f.open('rb') { |h| entry.write(h.read) }
55
+ # end
56
+ # end
57
+ # end
58
+ # end
59
+ # end
60
+ #
61
+ # metadata
62
+ # end
63
+ #
64
+ # desc 'push PATH', 'Publish cookbook at PATH to supermarket.chef.io'
65
+ # option 'chef-config', :type => :string,
66
+ # :aliases => :c,
67
+ # :default => File.join(ENV['HOME'], '.chef/knife.rb')
68
+ # option :site, :type => :string, :aliases => :s
69
+ # option :user, :type => :string, :aliases => :u
70
+ # option :key, :type => :string, :aliases => :k
71
+ # def push(cookbook = nil)
72
+ # Chef::Config.from_file(options['chef-config'])
73
+ # Util::Cookbook.path(cookbook) unless cookbook.nil?
74
+ #
75
+ # ## Set defaults after Chef::Config is loaded
76
+ # options['site'] ||= Chef::Config.knife['supermarket_site'] || 'https://supermarket.chef.io/'
77
+ # options['user'] ||= Chef::Config.knife['supermarket_user'] || Chef::Config.node_name
78
+ # options['key'] ||= Chef::Config.knife['supermarket_key'] || Chef::Config.client_key
79
+ #
80
+ # ## Build the cookbook taball
81
+ # metadata = invoke(Tasks::Cookbook, :build, [cookbook], options)
82
+ # say_status :upload, "cookbook #{ metadata.name }@#{ metadata.version } to #{ options['site'] }"
83
+ #
84
+ # metadata.archive.open('rb') do |c|
85
+ # http_resp = Chef::CookbookSiteStreamingUploader.post(
86
+ # File.join(options['site'], '/api/v1/cookbooks'),
87
+ # options['user'],
88
+ # options['key'],
89
+ # :tarball => c,
90
+ # :cookbook => { :category => '' }.to_json
91
+ # )
92
+ #
93
+ # if http_resp.code.to_i != 201
94
+ # say_status :error, "Error uploading cookbook: #{ http_resp.code } #{ http_resp.message }", :red
95
+ # say http_resp.body
96
+ # exit(1)
97
+ # end
98
+ # end
99
+ # end
100
+ #
101
+ # desc 'version COOKBOOK', 'Print the current version of a vendored cookbook'
102
+ # option :path, :default => Util::Cookbook::DEFAULT_VENDOR, :desc => 'Path to vendored cookbooks'
103
+ # def version(cookbook)
104
+ # Util::Cookbook.path(File.join(options['path'], cookbook))
105
+ # puts Util::Cookbook.metadata.version
106
+ # end
107
+ # end
108
+ # end
109
+ # end
data/rvm.env CHANGED
@@ -1,7 +1,7 @@
1
1
  declare -x GEM_HOME="/home/jenkins/.rvm/gems/ruby-2.1.5@bakery-3"
2
2
  declare -x GEM_PATH="/home/jenkins/.rvm/gems/ruby-2.1.5@bakery-3:/home/jenkins/.rvm/gems/ruby-2.1.5@global"
3
3
  declare -x HOME="/home/jenkins"
4
- declare -x HUDSON_COOKIE="dfc084f6-1a14-4b8c-8779-4ebe178fd701"
4
+ declare -x HUDSON_COOKIE="fa73e063-2dba-4b23-856a-06ccf35d11cb"
5
5
  declare -x IRBRC="/home/jenkins/.rvm/rubies/ruby-2.1.5/.irbrc"
6
6
  declare -x LANG="en_US.UTF-8"
7
7
  declare -x LC_ALL="en_US.UTF-8"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: builderator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Manero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-20 00:00:00.000000000 Z
11
+ date: 2016-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: chef
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '12.5'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '12.5'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: faraday_middleware
113
127
  requirement: !ruby/object:Gem::Requirement