omnibus 2.0.0 → 2.0.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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 615ef0c044c0b061d63bfb1f38967c858ebdf06d
4
- data.tar.gz: 68330f662a2f3e117645930ba0ac28cc2e0ea72c
3
+ metadata.gz: 9cb199e33038976c285414cab34ac29647f747d0
4
+ data.tar.gz: 1a6b1c603430011d328ff2acee1efec31cc406a5
5
5
  SHA512:
6
- metadata.gz: 564d392decbcb7449a32dc8670f59ca89c8d672e731e447e9e6b0fb34580976cbe564660723722ce70c5af61e379990ae2e73b4d6062e59966a486af57a9949b
7
- data.tar.gz: d3fcf09a23440d44a7f77a1e0735814a81fe7522070232d55f0660590ac112da13719ebd6e1a44bc2f912e36dab9b35e95d9dc3d3393f61c6d3f5f8e3ca84f2c
6
+ metadata.gz: 6f4b8cdec1c3027860afd61552649b39ff5b3b51a88f77e28696d7e5dfe76df3a5076413522aadd482ded167d07270febe3f25a7eaf3f2235a914eb53fd8be29
7
+ data.tar.gz: 073cad03cc5dae6e817a725ad447d360028ed2e3864859b47d8aadb0d433a04526f07b46663102df8e657ba7d9e61b32aea771de13d1015bd2343e0f48431802
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  Omnibus Ruby CHANGELOG
2
2
  ======================
3
3
 
4
+ v2.0.1 (March 18, 2014)
5
+ -----------------------
6
+ - Fix the name of the `pkg` artifact created on OSX
7
+ - Fix new Rubocop warnings
8
+ - Update generated `Gemfile` to use Omnibus 2.0
9
+ - Switch to using Test Kitchen for generated build labs
10
+
4
11
  v2.0.0 (March, 12, 2014)
5
12
  ------------------------
6
13
  Major changes:
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ Rubocop::RakeTask.new(:style)
10
10
 
11
11
  namespace :travis do
12
12
  desc 'Run tests on Travis'
13
- task ci: ['style', 'unit']
13
+ task ci: ['unit', 'style']
14
14
  end
15
15
 
16
16
  task default: ['travis:ci']
@@ -230,7 +230,11 @@ module Omnibus
230
230
  # @return [Boolean]
231
231
  # @see #prerelease_tag
232
232
  def prerelease_version?
233
- !!(prerelease_tag)
233
+ if prerelease_tag
234
+ true
235
+ else
236
+ false
237
+ end
234
238
  end
235
239
 
236
240
  private
@@ -130,7 +130,7 @@ module Omnibus
130
130
  File.expand_path("#{root}/config/patches/#{name}/#{args[:source]}")
131
131
  end
132
132
 
133
- source = candidate_paths.find { |path| File.exists?(path) }
133
+ source = candidate_paths.find { |path| File.exist?(path) }
134
134
 
135
135
  unless source
136
136
  fail MissingPatch.new(args[:source], candidate_paths)
@@ -152,7 +152,7 @@ module Omnibus
152
152
 
153
153
  source_path = File.expand_path("#{Omnibus.project_root}/config/templates/#{name}/#{args[:source]}")
154
154
 
155
- unless File.exists?(source_path)
155
+ unless File.exist?(source_path)
156
156
  fail MissingTemplate.new(args[:source], "#{Omnibus.project_root}/config/templates/#{name}")
157
157
  end
158
158
 
@@ -331,7 +331,7 @@ module Omnibus
331
331
  hash.reduce([]) do |kv_pair_strs, (k, v)|
332
332
  val_str = case v
333
333
  when Hash
334
- %Q["#{to_kv_str(v, " ") }"]
334
+ %Q("#{to_kv_str(v, " ") }")
335
335
  else
336
336
  v.to_s
337
337
  end
@@ -76,12 +76,13 @@ module Omnibus
76
76
  template(File.join('software', 'erlang-example.rb.erb'), File.join(config_software, 'erlang-example.rb'), opts)
77
77
  template(File.join('software', 'ruby-example.rb.erb'), File.join(config_software, 'ruby-example.rb'), opts)
78
78
 
79
- # Vagrant build lab
79
+ # Kitchen build environment
80
+ template(File.join('.kitchen.local.yml.erb'), File.join(target, '.kitchen.local.yml'), opts)
81
+ template(File.join('.kitchen.yml.erb'), File.join(target, '.kitchen.yml'), opts)
80
82
  template(File.join('Berksfile.erb'), File.join(target, 'Berksfile'), opts)
81
- template(File.join('Vagrantfile.erb'), File.join(target, 'Vagrantfile'), opts)
82
83
 
83
84
  # render out stub packge scripts
84
- %w{ makeselfinst preinst prerm postinst postrm }.each do |package_script|
85
+ %w(makeselfinst preinst prerm postinst postrm).each do |package_script|
85
86
  script_path = File.join(target, 'package-scripts', name, package_script)
86
87
  template_path = File.join('package_scripts', "#{package_script}.erb")
87
88
  # render the package script
@@ -56,11 +56,11 @@ E
56
56
  end
57
57
 
58
58
  def fetch_required?
59
- !File.exists?(project_file) || Digest::MD5.file(project_file) != @checksum
59
+ !File.exist?(project_file) || Digest::MD5.file(project_file) != @checksum
60
60
  end
61
61
 
62
62
  def clean
63
- if File.exists?(project_dir)
63
+ if File.exist?(project_dir)
64
64
  log "cleaning existing build from #{project_dir}"
65
65
  FileUtils.rm_rf(project_dir)
66
66
  end
@@ -155,7 +155,7 @@ E
155
155
  fail UnsupportedURIScheme, "Don't know how to download from #{source_uri}"
156
156
  end
157
157
  rescue Exception
158
- tries = tries - 1
158
+ tries -= 1
159
159
  if tries != 0
160
160
  log 'retrying failed download...'
161
161
  retry
@@ -46,6 +46,10 @@ module Omnibus
46
46
  # @return (see Project#build_version)
47
47
  def_delegator :@project, :build_version, :version
48
48
 
49
+ # !@method iteration
50
+ # @return (see Project#iteration)
51
+ def_delegator :@project, :iteration, :iteration
52
+
49
53
  # !@method identifier
50
54
  # @return (see Project#mac_pkg_identifier)
51
55
  def_delegator :@project, :mac_pkg_identifier, :identifier
@@ -125,7 +129,7 @@ module Omnibus
125
129
  # to customize the installer UI.
126
130
  # @return [Array<String>] argv for the pkgbuild command.
127
131
  def pkgbuild_command
128
- %W[
132
+ %W(
129
133
  pkgbuild
130
134
  --identifier #{identifier}
131
135
  --version #{version}
@@ -133,7 +137,7 @@ module Omnibus
133
137
  --root #{pkg_root}
134
138
  --install-location #{install_location}
135
139
  #{component_pkg_name}
136
- ]
140
+ )
137
141
  end
138
142
 
139
143
  # The argv for a productbuild command that will build the product package.
@@ -141,12 +145,12 @@ module Omnibus
141
145
  # users.
142
146
  # @return [Array<String>] argv for the productbuild command
143
147
  def productbuild_command
144
- %W[
148
+ %W(
145
149
  productbuild
146
150
  --distribution #{distribution_staging_path}
147
151
  --resources #{mac_pkg_files_path}
148
152
  #{product_pkg_path}
149
- ]
153
+ )
150
154
  end
151
155
 
152
156
  # Writes the Distribution file to the staging area.
@@ -171,7 +175,7 @@ module Omnibus
171
175
  #
172
176
  # @return [String] the basename of the package file
173
177
  def package_name
174
- "#{name}.pkg"
178
+ "#{name}-#{version}-#{iteration}.pkg"
175
179
  end
176
180
 
177
181
  def identifier
@@ -689,13 +689,13 @@ module Omnibus
689
689
  end
690
690
 
691
691
  if @pkg_user
692
- %w[ deb rpm solaris ].each do |type|
692
+ %w(deb rpm solaris).each do |type|
693
693
  command_and_opts << " --#{type}-user #{@pkg_user}"
694
694
  end
695
695
  end
696
696
 
697
697
  if @pkg_group
698
- %w[ deb rpm solaris ].each do |type|
698
+ %w(deb rpm solaris).each do |type|
699
699
  command_and_opts << " --#{type}-group #{@pkg_group}"
700
700
  end
701
701
  end
@@ -719,7 +719,7 @@ module Omnibus
719
719
  output_package('makeself'),
720
720
  "'The full stack of #{@name}'",
721
721
  ]
722
- command_and_opts << './makeselfinst' if File.exists?("#{package_scripts_path}/makeselfinst")
722
+ command_and_opts << './makeselfinst' if File.exist?("#{package_scripts_path}/makeselfinst")
723
723
  command_and_opts
724
724
  end
725
725
 
@@ -729,7 +729,7 @@ module Omnibus
729
729
  def run_makeself
730
730
  package_commands = []
731
731
  # copy the makeself installer into package
732
- if File.exists?("#{package_scripts_path}/makeselfinst")
732
+ if File.exist?("#{package_scripts_path}/makeselfinst")
733
733
  package_commands << "cp #{package_scripts_path}/makeselfinst #{install_path}/"
734
734
  end
735
735
 
@@ -479,7 +479,7 @@ module Omnibus
479
479
  directory project_dir
480
480
  namespace @name do
481
481
  task fetch: [build_dir, source_dir, cache_dir, project_dir] do
482
- if !File.exists?(fetch_file) || fetcher.fetch_required?
482
+ if !File.exist?(fetch_file) || fetcher.fetch_required?
483
483
  # force build to run if we need to do an updated fetch
484
484
  fetcher.fetch
485
485
  touch fetch_file
@@ -0,0 +1,10 @@
1
+ #
2
+ # The .kitchen.local.yml takes preference and is compiled into the top-level
3
+ # .kitchen.yml. Uncomment the following section to use VMWare Fusion instead of
4
+ # the default Vagrant driver of VirtualBox.
5
+ #
6
+
7
+ # driver:
8
+ # provider: vmware_fusion
9
+ # customize:
10
+ # memsize: 4096
@@ -0,0 +1,26 @@
1
+ driver:
2
+ name: vagrant
3
+ customize:
4
+ cpus: 2
5
+ memory: 2048
6
+ synced_folders:
7
+ - ['.', '/home/vagrant/<%= config[:name] %>']
8
+
9
+ provisioner:
10
+ require_chef_omnibus: 11.8.0
11
+
12
+ platforms:
13
+ - name: ubuntu-12.04
14
+ - name: ubuntu-11.04
15
+ - name: ubuntu-10.04
16
+ - name: centos-5.10
17
+ - name: centos-6.5
18
+
19
+ suites:
20
+ - name: default
21
+ run_list: omnibus::default
22
+ attributes:
23
+ omnibus:
24
+ build_user: vagrant
25
+ build_dir: /home/vagrant/<%= config[:name] %>
26
+ install_dir: /opt/<%= config[:name] %>
@@ -1,3 +1,6 @@
1
- site :opscode
1
+ source 'https://api.berkshelf.com'
2
2
 
3
- cookbook "omnibus"
3
+ cookbook 'omnibus'
4
+
5
+ # Uncomment to use the latest version of the Omnibus cookbook from GitHub
6
+ # cookbook 'omnibus', github: 'opscode-cookbooks/omnibus'
@@ -1,4 +1,12 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'omnibus', '~> 1.3.0'
4
- gem 'omnibus-software', :git => 'git://github.com/opscode/omnibus-software.git', :branch => 'master'
3
+ # Use Berkshelf for resolving cookbook dependencies
4
+ gem 'berkshelf', '~> 3.0.0.beta'
5
+
6
+ # Install omnibus software
7
+ gem 'omnibus', '~> 2.0'
8
+ gem 'omnibus-software', github: 'opscode/omnibus-software'
9
+
10
+ # Use Test Kitchen with Vagrant for convering the build environment
11
+ gem 'test-kitchen', '~> 1.2'
12
+ gem 'kitchen-vagrant', '~> 0.14'
@@ -1,19 +1,19 @@
1
- # <%= config[:name] %> Omnibus project
2
-
1
+ <%= config[:name] %> Omnibus project
2
+ <%= '='*(config[:name].length + 16) %>
3
3
  This project creates full-stack platform-specific packages for
4
4
  `<%= config[:name] %>`!
5
5
 
6
- ## Installation
7
-
8
- We'll assume you have Ruby 1.9+ and Bundler installed. First ensure all
9
- required gems are installed and ready to use:
6
+ Installation
7
+ ------------
8
+ You must have a sane Ruby 1.9+ environment with Bundler installed. Ensure all
9
+ the required gems are installed:
10
10
 
11
11
  ```shell
12
12
  $ bundle install --binstubs
13
13
  ```
14
14
 
15
- ## Usage
16
-
15
+ Usage
16
+ -----
17
17
  ### Build
18
18
 
19
19
  You create a platform-specific package using the `build project` command:
@@ -23,9 +23,9 @@ $ bin/omnibus build project <%= config[:name] %>
23
23
  ```
24
24
 
25
25
  The platform/architecture type of the package created will match the platform
26
- where the `build project` command is invoked. So running this command on say a
27
- MacBook Pro will generate a Mac OS X specific package. After the build
28
- completes packages will be available in `pkg/`.
26
+ where the `build project` command is invoked. For example, running this command
27
+ on a MacBook Pro will generate a Mac OS X package. After the build completes
28
+ packages will be available in the `pkg/` folder.
29
29
 
30
30
  ### Clean
31
31
 
@@ -53,50 +53,42 @@ Full help for the Omnibus command line interface can be accessed with the
53
53
  $ bin/omnibus help
54
54
  ```
55
55
 
56
- ## Vagrant-based Virtualized Build Lab
57
-
56
+ Kitchen-based Build Environment
57
+ -------------------------------
58
58
  Every Omnibus project ships will a project-specific
59
59
  [Berksfile](http://berkshelf.com/) and [Vagrantfile](http://www.vagrantup.com/)
60
- that will allow you to build your projects on the following platforms:
61
-
62
- * CentOS 5 64-bit
63
- * CentOS 6 64-bit
64
- * Ubuntu 10.04 64-bit
65
- * Ubuntu 11.04 64-bit
66
- * Ubuntu 12.04 64-bit
60
+ that will allow you to build your omnibus projects on all of the projects listed
61
+ in the `.kitchen.yml`. You can add/remove additional platforms as needed by
62
+ changing the list found in the `.kitchen.yml` `platforms` YAML stanza.
67
63
 
68
- Please note this build-lab is only meant to get you up and running quickly;
69
- there's nothing inherent in Omnibus that restricts you to just building CentOS
70
- or Ubuntu packages. See the Vagrantfile to add new platforms to your build lab.
64
+ This build environment is designed to get you up-and-running quickly. However,
65
+ there is nothing that restricts you to building on other platforms. Simply use
66
+ the [omnibus cookbook](https://github.com/opscode-cookbooks/omnibus) to setup
67
+ your desired platform and execute the build steps listed above.
71
68
 
72
- The only requirements for standing up this virtualized build lab are:
73
-
74
- * VirtualBox - native packages exist for most platforms and can be downloaded
75
- from the [VirtualBox downloads page](https://www.virtualbox.org/wiki/Downloads).
76
- * Vagrant 1.2.1+ - native packages exist for most platforms and can be downloaded
77
- from the [Vagrant downloads page](http://downloads.vagrantup.com/).
78
-
79
- The [vagrant-berkshelf](https://github.com/RiotGames/vagrant-berkshelf) and
80
- [vagrant-omnibus](https://github.com/schisamo/vagrant-omnibus) Vagrant plugins
81
- are also required and can be installed easily with the following commands:
82
-
83
- ```shell
84
- $ vagrant plugin install vagrant-berkshelf
85
- $ vagrant plugin install vagrant-omnibus
86
- ```
69
+ The default build environment requires Test Kitchen and VirtualBox for local
70
+ development. Test Kitchen also exposes the ability to provision instances using
71
+ various cloud providers like AWS, DigitalOcean, or OpenStack. For more
72
+ information, please see the [Test Kitchen documentation](http://kitchen.ci).
87
73
 
88
- Once the pre-requisites are installed you can build your package across all
89
- platforms with the following command:
74
+ Once you have tweaked your `.kitchen.yml` (or `.kitchen.local.yml`) to your
75
+ liking, you can bring up an individual build environment using the `kitchen`
76
+ command.
90
77
 
91
78
  ```shell
92
- $ vagrant up
79
+ $ bundle exec kitchen converge ubuntu-12.04
93
80
  ```
94
81
 
95
- If you would like to build a package for a single platform the command looks like this:
82
+ Then login to the instance and build the project as described in the Usage
83
+ section:
96
84
 
97
85
  ```shell
98
- $ vagrant up PLATFORM
86
+ $ bundle exec kitchen login ubuntu-12.04
87
+ [vagrant@ubuntu...] $ cd <%= config[:name] %>
88
+ [vagrant@ubuntu...] $ bundle install
89
+ [vagrant@ubuntu...] $ ...
90
+ [vagrant@ubuntu...] $ ./bin/omnibus build project <%= config[:name] %>
99
91
  ```
100
92
 
101
- The complete list of valid platform names can be viewed with the
102
- `vagrant status` command.
93
+ For a complete list of all commands and platforms, run `kitchen list` or
94
+ `kitchen help`.
@@ -1,5 +1,7 @@
1
1
  *.gem
2
2
  .bundle
3
+ .kitchen/
4
+ .kitchen.local.yml
3
5
  vendor/bundle
4
6
  pkg/*
5
7
  .vagrant
@@ -1,6 +1,6 @@
1
- # s3_access_key "something"
2
- # s3_secret_key "something"
3
- # s3_bucket "some-bucket"
1
+ # s3_access_key 'something'
2
+ # s3_secret_key 'something'
3
+ # s3_bucket 'some-bucket'
4
4
  # use_s3_caching true
5
- # solaris_compiler "gcc"
5
+ # solaris_compiler 'gcc'
6
6
  # build_retries 3
@@ -1,21 +1,21 @@
1
1
 
2
- name "<%= config[:name] %>"
3
- maintainer "CHANGE ME"
4
- homepage "CHANGEME.com"
2
+ name '<%= config[:name] %>'
3
+ maintainer 'CHANGE ME'
4
+ homepage 'CHANGEME.com'
5
5
 
6
- replaces "<%= config[:name] %>"
7
- install_path "<%= config[:install_path] %>"
6
+ replaces '<%= config[:name] %>'
7
+ install_path '<%= config[:install_path] %>'
8
8
  build_version Omnibus::BuildVersion.new.semver
9
9
  build_iteration 1
10
10
 
11
11
  # creates required build directories
12
- dependency "preparation"
12
+ dependency 'preparation'
13
13
 
14
14
  # <%= config[:name] %> dependencies/components
15
- # dependency "somedep"
15
+ # dependency 'somedep'
16
16
 
17
17
  # version manifest file
18
- dependency "version-manifest"
18
+ dependency 'version-manifest'
19
19
 
20
- exclude "\.git*"
21
- exclude "bundler\/git"
20
+ exclude '\.git*'
21
+ exclude 'bundler\/git'
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module Omnibus
19
- VERSION = '2.0.0'
19
+ VERSION = '2.0.1'
20
20
  end
@@ -82,7 +82,7 @@ describe Omnibus::GitFetcher do
82
82
 
83
83
  it 'should clone the Git repository and then fail while retrying 3 times' do
84
84
  expect(error_reporter).to receive(:explain)
85
- .with(%|Failed to fetch git repository 'git@example.com:test/project.git'|)
85
+ .with(%(Failed to fetch git repository 'git@example.com:test/project.git'))
86
86
 
87
87
  4.times do
88
88
  expect_git_clone
@@ -64,16 +64,16 @@ EOH
64
64
  let(:expected_distribution_path) { '/var/cache/omnibus/pkg-tmp/mac-pkg/Distribution' }
65
65
 
66
66
  let(:productbuild_argv) do
67
- %W[
67
+ %W(
68
68
  productbuild
69
69
  --distribution #{expected_distribution_path}
70
70
  --resources /omnibus/project/root/files/mac_pkg/Resources
71
- /home/someuser/omnibus-myproject/pkg/myproject.pkg
72
- ]
71
+ /home/someuser/omnibus-myproject/pkg/myproject-23.4.2-4.pkg
72
+ )
73
73
  end
74
74
 
75
75
  let(:pkgbuild_argv) do
76
- %w[
76
+ %w(
77
77
  pkgbuild
78
78
  --identifier com.mycorp.myproject
79
79
  --version 23.4.2
@@ -81,7 +81,7 @@ EOH
81
81
  --root /opt/myproject
82
82
  --install-location /opt/myproject
83
83
  myproject-core.pkg
84
- ]
84
+ )
85
85
  end
86
86
 
87
87
  let(:shellout_opts) do
@@ -95,6 +95,7 @@ EOH
95
95
  double Omnibus::Project,
96
96
  name: project_name,
97
97
  build_version: '23.4.2',
98
+ iteration: 4,
98
99
  maintainer: "Joe's Software",
99
100
  install_path: '/opt/myproject',
100
101
  package_scripts_path: scripts_path,
@@ -135,8 +136,8 @@ EOH
135
136
  it 'names the product package PROJECT_NAME.pkg' do
136
137
  # NOTE: #package_name is used by Project, so it's part of the **PUBLIC**
137
138
  # API.
138
- expect(packager.package_name).to eq('myproject.pkg')
139
- expect(packager.product_pkg_name).to eq('myproject.pkg')
139
+ expect(packager.package_name).to eq('myproject-23.4.2-4.pkg')
140
+ expect(packager.product_pkg_name).to eq('myproject-23.4.2-4.pkg')
140
141
  end
141
142
 
142
143
  it "use's the project's package_scripts_path" do
@@ -145,7 +146,7 @@ EOH
145
146
 
146
147
  it "makes a list of required files to generate the 'product' pkg file" do
147
148
  project_file_path = '/omnibus/project/root/files/mac_pkg/Resources'
148
- required_files = %w[background.png welcome.html license.html].map do |basename|
149
+ required_files = %w(background.png welcome.html license.html).map do |basename|
149
150
  File.join(project_file_path, basename)
150
151
  end
151
152
 
@@ -246,7 +247,7 @@ E
246
247
 
247
248
  before do
248
249
  project_file_path = '/omnibus/project/root/files/mac_pkg/Resources'
249
- %w[background.png welcome.html license.html].each do |basename|
250
+ %w(background.png welcome.html license.html).each do |basename|
250
251
  path = File.join(project_file_path, basename)
251
252
  File.stub(:exist?).with(path).and_return(true)
252
253
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnibus
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.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-03-12 00:00:00.000000000 Z
11
+ date: 2014-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout
@@ -202,6 +202,8 @@ files:
202
202
  - lib/omnibus/reports.rb
203
203
  - lib/omnibus/s3_cacher.rb
204
204
  - lib/omnibus/software.rb
205
+ - lib/omnibus/templates/.kitchen.local.yml.erb
206
+ - lib/omnibus/templates/.kitchen.yml.erb
205
207
  - lib/omnibus/templates/Berksfile.erb
206
208
  - lib/omnibus/templates/Gemfile.erb
207
209
  - lib/omnibus/templates/README.md.erb