omnibus 3.2.0 → 3.2.1

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 CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NDQ2ZjE2OWViMWMxZGQ1NjIyOGRkZTc5ZGVmNTVlMTVlYmY4Njk0MQ==
5
- data.tar.gz: !binary |-
6
- MmM1ODJlYTM0MzU2M2Y4NzI0ZmVlNTQ0NjFkMDExNDE3ODg2M2FjMA==
2
+ SHA1:
3
+ metadata.gz: 918d6850bef241b13e3ff6665654df11a2ae6a2b
4
+ data.tar.gz: 05f1d0d1328afd8c59f9662a8e400ff409de4d5c
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZDQzMjQ2MDk0MDU5NmFhMDczZDNiZTYwZjk3NDE3ZGY5NDU3MjYxYmVhNzUw
10
- ZGQxNGQ3YWE2NjFiNWFhYzUxOTM4ZjEwYzcxMjVmY2U2NmU0ZTNjODYwOGZj
11
- NTdhNzAxMjZhNjcyNjQzMWU0ZjVkODAzM2M4ZTRjMTU0ZWIxNTQ=
12
- data.tar.gz: !binary |-
13
- NTdiYmVlYmExNzk2NTg4ODAwYjQxNGQ4YWZkOGZiNDlhZmNiZjMwNjA0MTI0
14
- OWE4NzljZmI3MTM2MTllZDgyMGM4ZGJmNTdiMzhkNTNjMWMwOTFkYmU0Zjdm
15
- ZTdlOWZmYTY4OWY5NjAzYTg0MGY2NjdjNTA0MzA5Y2Y5NDIzNTk=
6
+ metadata.gz: 05c1df0c773e1dbce6e2de4e6e2019dc5a8c135c61121134af9959b6c742e6c9d3e7c7f274607bf64f724d4c4967a133af2c55ed00ac15887803e71ed66c2d05
7
+ data.tar.gz: a6acb3352284b375ac8359ad060eaabc75d18e0871b8c3eda968a3434d7088fbc58dab8336e2bd635b7124366782caa38a56eb75b404378956b36797ee154322
@@ -7,6 +7,8 @@ bundler_args: --jobs 7 --without docs local
7
7
 
8
8
  branches:
9
9
  only:
10
+ - 2.0-stable
11
+ - 3.0-stable
10
12
  - master
11
13
 
12
14
  script: bundle exec rake travis:ci
@@ -1,6 +1,12 @@
1
1
  Omnibus Ruby CHANGELOG
2
2
  ======================
3
3
 
4
+ v3.2.1 (July 26, 2014)
5
+ ----------------------
6
+ - Add support for overriding publish platform/version
7
+ - Expose platform/version override options on `omnibus publish`
8
+ - Expose the `sync` method in the builder DSL and fix the broken tests
9
+
4
10
  v3.2.0 (July 23, 2014)
5
11
  ----------------------
6
12
  - Make build commands output during `log.info` instead of `log.debug`
@@ -0,0 +1,13 @@
1
+ Feature: omnibus publish
2
+ Scenario: Overriding publishing platform
3
+ * I run `omnibus publish artifactory fake * --platform debian`
4
+ * the output should contain:
5
+ """
6
+ Publishing platform has been overriden to 'debian'
7
+ """
8
+ Scenario: Overriding publishing platform version
9
+ * I run `omnibus publish artifactory fake * --platform-version 7`
10
+ * the output should contain:
11
+ """
12
+ Publishing platform version has been overriden to '7'
13
+ """
@@ -567,6 +567,7 @@ module Omnibus
567
567
  end
568
568
  end
569
569
  end
570
+ expose :sync
570
571
 
571
572
  #
572
573
  # @!endgroup
@@ -18,6 +18,21 @@ module Omnibus
18
18
  class Command::Publish < Command::Base
19
19
  namespace :publish
20
20
 
21
+ # These options are useful for publish packages that were built for a
22
+ # paticluar platform/version and tested on another platform/version.
23
+ #
24
+ # For example, one might build on Ubuntu 10.04 and test/publish on
25
+ # Ubuntu 11.04, 12.04 and Debian 7.
26
+ #
27
+ # If these options are used with the glob pattern support all packages
28
+ # will be published to the same platform/version.
29
+ class_option :platform,
30
+ desc: 'The platform to publish for',
31
+ type: :string
32
+ class_option :platform_version,
33
+ desc: 'The platform version to publish for',
34
+ type: :string
35
+
21
36
  #
22
37
  # Publish to S3.
23
38
  #
@@ -41,6 +41,18 @@ module Omnibus
41
41
  def initialize(pattern, options = {})
42
42
  @pattern = pattern
43
43
  @options = options.dup
44
+
45
+ if @options[:platform]
46
+ log.warn(log_key) do
47
+ "Publishing platform has been overriden to '#{@options[:platform]}'"
48
+ end
49
+ end
50
+
51
+ if @options[:platform_version]
52
+ log.warn(log_key) do
53
+ "Publishing platform version has been overriden to '#{@options[:platform_version]}'"
54
+ end
55
+ end
44
56
  end
45
57
 
46
58
  #
@@ -67,6 +79,45 @@ module Omnibus
67
79
 
68
80
  private
69
81
 
82
+ #
83
+ # The platform to publish a package for. A publisher can be optionally
84
+ # initialized with a platform which should be used in all publishing
85
+ # logic. This allows a package built on one platform to be published
86
+ # for another platform. For example, one might build on Ubuntu and
87
+ # test/publish on Ubuntu and Debian.
88
+ #
89
+ # @note Even if a glob pattern matches multiple packages (potentially
90
+ # across multiple platforms) all packages will be published for the
91
+ # same platform.
92
+ #
93
+ # @param [Package] package
94
+ #
95
+ # @return [String]
96
+ #
97
+ def publish_platform(package)
98
+ @options[:platform] || package.metadata[:platform]
99
+ end
100
+
101
+ #
102
+ # The platform version to publish a package for. A publisher can be
103
+ # optionally initialized with a platform version which should be used
104
+ # in all publishing logic. This allows a package built on one
105
+ # platform to be published for another platform version. For example,
106
+ # one might build on Ubuntu 10.04 and test/publish on Ubuntu 10.04
107
+ # and 12.04.
108
+ #
109
+ # @note Even if a glob pattern matches multiple packages (potentially
110
+ # across multiple platforms) all packages will be published for the
111
+ # same platform version.
112
+ #
113
+ # @param [Package] package
114
+ #
115
+ # @return [String]
116
+ #
117
+ def publish_platform_version(package)
118
+ @options[:platform_version] || package.metadata[:platform_version]
119
+ end
120
+
70
121
  def safe_require(name)
71
122
  require name
72
123
  rescue LoadError
@@ -91,8 +91,8 @@ module Omnibus
91
91
  def metadata_for(package)
92
92
  {
93
93
  'omnibus.project' => package.metadata[:name],
94
- 'omnibus.platform' => package.metadata[:platform],
95
- 'omnibus.platform_version' => package.metadata[:platform_version],
94
+ 'omnibus.platform' => publish_platform(package),
95
+ 'omnibus.platform_version' => publish_platform_version(package),
96
96
  'omnibus.architecture' => package.metadata[:arch],
97
97
  'omnibus.version' => package.metadata[:version],
98
98
  'omnibus.iteration' => package.metadata[:iteration],
@@ -130,8 +130,8 @@ module Omnibus
130
130
  Config.artifactory_base_path,
131
131
  package.metadata[:name],
132
132
  package.metadata[:version],
133
- package.metadata[:platform],
134
- package.metadata[:platform_version],
133
+ publish_platform(package),
134
+ publish_platform_version(package),
135
135
  package.metadata[:basename],
136
136
  )
137
137
  end
@@ -72,8 +72,8 @@ module Omnibus
72
72
  #
73
73
  def key_for(package, *stuff)
74
74
  File.join(
75
- package.metadata[:platform],
76
- package.metadata[:platform_version],
75
+ publish_platform(package),
76
+ publish_platform_version(package),
77
77
  package.metadata[:arch],
78
78
  package.name,
79
79
  *stuff,
@@ -15,5 +15,5 @@
15
15
  #
16
16
 
17
17
  module Omnibus
18
- VERSION = '3.2.0'
18
+ VERSION = '3.2.1'
19
19
  end
@@ -39,7 +39,7 @@ module Omnibus
39
39
  it_behaves_like 'a cleanroom setter', :copy, %|copy 'file', 'file2'|
40
40
  it_behaves_like 'a cleanroom setter', :move, %|move 'file', 'file2'|
41
41
  it_behaves_like 'a cleanroom setter', :link, %|link 'file', 'file2'|
42
- it_behaves_like 'a cleanroom setter', :sync, %|link 'a/', 'b/'|
42
+ it_behaves_like 'a cleanroom setter', :sync, %|sync 'a/', 'b/'|
43
43
  it_behaves_like 'a cleanroom getter', :project_root, %|puts project_root|
44
44
  it_behaves_like 'a cleanroom getter', :windows_safe_path, %|puts windows_safe_path('foo')|
45
45
 
@@ -58,12 +58,32 @@ module Omnibus
58
58
  expect(artifact).to receive(:upload).with(
59
59
  repository,
60
60
  'com/getchef/chef/11.0.6/ubuntu/14.04/chef.deb',
61
- an_instance_of(Hash)
61
+ an_instance_of(Hash),
62
62
  ).once
63
63
 
64
64
  subject.publish
65
65
  end
66
66
 
67
+ context 'when an alternate platform and platform version are provided' do
68
+ subject do
69
+ described_class.new(path,
70
+ repository: repository,
71
+ platform: 'debian',
72
+ platform_version: '7',
73
+ )
74
+ end
75
+
76
+ it 'overrides the platform and platform version used for publishing' do
77
+ expect(artifact).to receive(:upload).with(
78
+ repository,
79
+ 'com/getchef/chef/11.0.6/debian/7/chef.deb',
80
+ an_instance_of(Hash),
81
+ ).once
82
+
83
+ subject.publish
84
+ end
85
+ end
86
+
67
87
  context 'when a block is given' do
68
88
  it 'yields the package to the block' do
69
89
  block = ->(package) { package.do_something! }
@@ -96,6 +96,26 @@ module Omnibus
96
96
  end
97
97
  end
98
98
 
99
+ context 'when an alternate platform and platform version are provided' do
100
+ subject do
101
+ described_class.new(path,
102
+ platform: 'debian',
103
+ platform_version: '7',
104
+ )
105
+ end
106
+
107
+ it 'overrides the platform and platform version used for publishing' do
108
+ expect(client).to receive(:store).with(
109
+ 'debian/7/x86_64/chef.deb/chef.deb',
110
+ package.content,
111
+ access: :private,
112
+ content_md5: package.metadata[:md5],
113
+ ).once
114
+
115
+ subject.publish
116
+ end
117
+ end
118
+
99
119
  context 'when a block is given' do
100
120
  it 'yields the package to the block' do
101
121
  block = ->(package) { package.do_something! }
metadata CHANGED
@@ -1,195 +1,195 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnibus
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-23 00:00:00.000000000 Z
11
+ date: 2014-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-sugar
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mixlib-shellout
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.4'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.4'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ohai
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '7.2'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '7.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: fpm
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.4'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.4'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: uber-s3
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: thor
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0.18'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.18'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: bundler
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ! '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: artifactory
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ~>
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
117
  version: '1.2'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ~>
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '1.2'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: aruba
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0.5'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0.5'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: fauxhai
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ~>
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
145
  version: '2.1'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ~>
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '2.1'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rspec
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ~>
157
+ - - "~>"
158
158
  - !ruby/object:Gem::Version
159
159
  version: '3.0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ~>
164
+ - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '3.0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rspec-its
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ! '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ! '>='
178
+ - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: rake
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ! '>='
185
+ - - ">="
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ! '>='
192
+ - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  description: Omnibus is a framework for building self-installing, full-stack software
@@ -200,9 +200,9 @@ executables:
200
200
  extensions: []
201
201
  extra_rdoc_files: []
202
202
  files:
203
- - .gitignore
204
- - .rubocop.yml
205
- - .travis.yml
203
+ - ".gitignore"
204
+ - ".rubocop.yml"
205
+ - ".travis.yml"
206
206
  - CHANGELOG.md
207
207
  - Gemfile
208
208
  - LICENSE
@@ -219,6 +219,7 @@ files:
219
219
  - features/commands/clean.feature
220
220
  - features/commands/list.feature
221
221
  - features/commands/new.feature
222
+ - features/commands/publish.feature
222
223
  - features/commands/version.feature
223
224
  - features/step_definitions/generator_steps.rb
224
225
  - features/support/env.rb
@@ -481,17 +482,17 @@ require_paths:
481
482
  - lib
482
483
  required_ruby_version: !ruby/object:Gem::Requirement
483
484
  requirements:
484
- - - ! '>='
485
+ - - ">="
485
486
  - !ruby/object:Gem::Version
486
487
  version: 1.9.1
487
488
  required_rubygems_version: !ruby/object:Gem::Requirement
488
489
  requirements:
489
- - - ! '>='
490
+ - - ">="
490
491
  - !ruby/object:Gem::Version
491
492
  version: '0'
492
493
  requirements: []
493
494
  rubyforge_project:
494
- rubygems_version: 2.2.2
495
+ rubygems_version: 2.3.0
495
496
  signing_key:
496
497
  specification_version: 4
497
498
  summary: Omnibus is a framework for building self-installing, full-stack software
@@ -502,6 +503,7 @@ test_files:
502
503
  - features/commands/clean.feature
503
504
  - features/commands/list.feature
504
505
  - features/commands/new.feature
506
+ - features/commands/publish.feature
505
507
  - features/commands/version.feature
506
508
  - features/step_definitions/generator_steps.rb
507
509
  - features/support/env.rb