omnibus 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +8 -0
  3. data/.travis.yml +3 -11
  4. data/CHANGELOG.md +50 -0
  5. data/MAINTAINERS.md +26 -0
  6. data/README.md +61 -4
  7. data/appveyor.yml +35 -0
  8. data/docs/Build Cache.md +28 -3
  9. data/docs/Building on RHEL.md +1 -1
  10. data/features/commands/publish.feature +4 -9
  11. data/features/step_definitions/generator_steps.rb +14 -1
  12. data/features/support/env.rb +5 -3
  13. data/lib/omnibus.rb +10 -0
  14. data/lib/omnibus/build_version.rb +34 -25
  15. data/lib/omnibus/build_version_dsl.rb +43 -4
  16. data/lib/omnibus/builder.rb +30 -11
  17. data/lib/omnibus/changelog.rb +52 -0
  18. data/lib/omnibus/changelog_printer.rb +77 -0
  19. data/lib/omnibus/cli.rb +37 -2
  20. data/lib/omnibus/cli/changelog.rb +149 -0
  21. data/lib/omnibus/cli/publish.rb +30 -10
  22. data/lib/omnibus/config.rb +41 -2
  23. data/lib/omnibus/digestable.rb +6 -1
  24. data/lib/omnibus/exceptions.rb +15 -1
  25. data/lib/omnibus/fetcher.rb +78 -34
  26. data/lib/omnibus/fetchers/git_fetcher.rb +84 -42
  27. data/lib/omnibus/fetchers/net_fetcher.rb +64 -13
  28. data/lib/omnibus/fetchers/null_fetcher.rb +8 -1
  29. data/lib/omnibus/fetchers/path_fetcher.rb +24 -1
  30. data/lib/omnibus/file_syncer.rb +52 -1
  31. data/lib/omnibus/generator.rb +22 -21
  32. data/lib/omnibus/generator_files/.kitchen.yml.erb +8 -12
  33. data/lib/omnibus/generator_files/Berksfile.erb +4 -4
  34. data/lib/omnibus/generator_files/Gemfile.erb +3 -3
  35. data/lib/omnibus/generator_files/README.md.erb +17 -0
  36. data/lib/omnibus/generator_files/omnibus.rb.erb +6 -0
  37. data/lib/omnibus/git_repository.rb +43 -0
  38. data/lib/omnibus/health_check.rb +5 -1
  39. data/lib/omnibus/manifest.rb +134 -0
  40. data/lib/omnibus/manifest_diff.rb +88 -0
  41. data/lib/omnibus/manifest_entry.rb +43 -0
  42. data/lib/omnibus/metadata.rb +19 -1
  43. data/lib/omnibus/package.rb +9 -0
  44. data/lib/omnibus/packagers/base.rb +1 -1
  45. data/lib/omnibus/packagers/bff.rb +5 -5
  46. data/lib/omnibus/packagers/deb.rb +11 -4
  47. data/lib/omnibus/packagers/msi.rb +243 -2
  48. data/lib/omnibus/packagers/rpm.rb +68 -14
  49. data/lib/omnibus/packagers/solaris.rb +17 -23
  50. data/lib/omnibus/project.rb +129 -16
  51. data/lib/omnibus/publisher.rb +62 -49
  52. data/lib/omnibus/publishers/artifactory_publisher.rb +96 -5
  53. data/lib/omnibus/publishers/s3_publisher.rb +20 -25
  54. data/lib/omnibus/s3_cache.rb +13 -34
  55. data/lib/omnibus/s3_helpers.rb +119 -0
  56. data/lib/omnibus/semantic_version.rb +57 -0
  57. data/lib/omnibus/software.rb +87 -28
  58. data/lib/omnibus/sugarable.rb +18 -0
  59. data/lib/omnibus/templating.rb +8 -1
  60. data/lib/omnibus/version.rb +1 -1
  61. data/omnibus.gemspec +10 -7
  62. data/resources/bff/gen.template.erb +1 -1
  63. data/resources/msi/bundle.wxs.erb +17 -0
  64. data/resources/msi/localization-en-us.wxl.erb +1 -1
  65. data/resources/rpm/spec.erb +1 -1
  66. data/spec/functional/builder_spec.rb +15 -7
  67. data/spec/functional/fetchers/git_fetcher_spec.rb +44 -12
  68. data/spec/functional/fetchers/net_fetcher_spec.rb +171 -20
  69. data/spec/functional/fetchers/path_fetcher_spec.rb +16 -1
  70. data/spec/functional/file_syncer_spec.rb +58 -5
  71. data/spec/functional/templating_spec.rb +17 -6
  72. data/spec/spec_helper.rb +17 -0
  73. data/spec/support/file_helpers.rb +12 -2
  74. data/spec/support/git_helpers.rb +23 -18
  75. data/spec/support/matchers.rb +22 -0
  76. data/spec/support/output_helpers.rb +29 -0
  77. data/spec/unit/build_version_dsl_spec.rb +31 -4
  78. data/spec/unit/build_version_spec.rb +11 -4
  79. data/spec/unit/builder_spec.rb +33 -0
  80. data/spec/unit/changelog_spec.rb +55 -0
  81. data/spec/unit/cleanroom_spec.rb +1 -1
  82. data/spec/unit/compressors/dmg_spec.rb +3 -3
  83. data/spec/unit/compressors/tgz_spec.rb +3 -3
  84. data/spec/unit/config_spec.rb +3 -1
  85. data/spec/unit/fetcher_spec.rb +35 -0
  86. data/spec/unit/fetchers/git_fetcher_spec.rb +28 -14
  87. data/spec/unit/fetchers/net_fetcher_spec.rb +178 -24
  88. data/spec/unit/fetchers/path_fetcher_spec.rb +8 -7
  89. data/spec/unit/generator_spec.rb +22 -21
  90. data/spec/unit/git_repository_spec.rb +60 -0
  91. data/spec/unit/manifest_diff_spec.rb +75 -0
  92. data/spec/unit/manifest_spec.rb +116 -0
  93. data/spec/unit/metadata_spec.rb +11 -0
  94. data/spec/unit/omnibus_spec.rb +9 -6
  95. data/spec/unit/package_spec.rb +1 -1
  96. data/spec/unit/packagers/base_spec.rb +8 -18
  97. data/spec/unit/packagers/bff_spec.rb +9 -5
  98. data/spec/unit/packagers/deb_spec.rb +44 -12
  99. data/spec/unit/packagers/makeself_spec.rb +4 -4
  100. data/spec/unit/packagers/msi_spec.rb +122 -6
  101. data/spec/unit/packagers/pkg_spec.rb +3 -3
  102. data/spec/unit/packagers/rpm_spec.rb +37 -12
  103. data/spec/unit/project_spec.rb +18 -1
  104. data/spec/unit/publisher_spec.rb +65 -0
  105. data/spec/unit/publishers/artifactory_publisher_spec.rb +26 -20
  106. data/spec/unit/publishers/s3_publisher_spec.rb +14 -30
  107. data/spec/unit/s3_cacher_spec.rb +1 -1
  108. data/spec/unit/s3_helpers_spec.rb +32 -0
  109. data/spec/unit/semantic_version_spec.rb +55 -0
  110. data/spec/unit/software_spec.rb +112 -4
  111. metadata +86 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42ba84e6247d1cec8f21fb01ec6324e850a1e10e
4
- data.tar.gz: 74c043e787a3728d746c282cadb46ed4024cb99c
3
+ metadata.gz: 163fba58e122c1c52362ace044e0c484ad1862ee
4
+ data.tar.gz: 7964e3d739d4eaf3122f51e3e0a0127e74cb13d5
5
5
  SHA512:
6
- metadata.gz: 954792cc931a139486c646236e63c8d1a87c9f8841600918c769d262d943e886ed85fa7698b543acc6c0385849a55ea620331b6220812b2c57fcc9039192fa9c
7
- data.tar.gz: 81830612f63dc5664bd3257c9b232911c1730af9f0d3b7f31f53684424272d34262b9e154013caacc4f05c51531e25a3b382539a888fb49ac7ddf39a057cf69e
6
+ metadata.gz: 8de529d87a1c80f38e530d63a4f94fe9e3e7e354e4d41b73ce328f7a37ad01dd9e813a5fa1c29e98e2c2154dc0be72ff57257a74b1a35ae23fcd179080081153
7
+ data.tar.gz: 839e4f49104f111afcf88f4dc2d24a964bc0186d4c2dcb6b92c5857875b682c51ea4693ec0723d55dd17c7249eeed93dbce6da67bf505b831d685e04e4565200
data/.gitignore CHANGED
@@ -83,6 +83,14 @@ Gemfile.lock
83
83
  *.tmproject
84
84
  tmtags
85
85
 
86
+ # avoid generic ctags files too
87
+ tags
88
+ gems.tags
89
+ gemtags
90
+ .tags
91
+ .gem.tags
92
+ .gemtags
93
+ .tags_sorted_by_file
86
94
 
87
95
  ### SublimeText ###
88
96
  # workspace files are user-specific
@@ -1,26 +1,18 @@
1
1
  rvm:
2
- - 1.9.3
3
2
  - 2.0.0
4
3
  - 2.1
5
-
6
- bundler_args: --jobs 7 --without docs local
7
-
4
+ bundler_args: "--jobs 7 --without docs local"
8
5
  branches:
9
6
  only:
10
7
  - 2.0-stable
11
8
  - 3.0-stable
12
9
  - master
13
-
14
10
  script: bundle exec rake travis:ci
15
-
16
11
  notifications:
17
- hipchat:
12
+ slack:
18
13
  on_change: true
19
14
  on_failure: true
20
15
  on_success: false
21
16
  on_pull_requests: false
22
17
  rooms:
23
- # Build Statuses
24
- - secure: JdLOITSPHW5xk8eoFOmH1Js5PT6iFgswUG8fIqNq69ie2Qws2K58hPDR6HW2NBEsBb7dW1S5jT6V9RHhm0ykekvEJVa5AjebO3EsZa+Cu/VahFMg4DL+SGYgKlKrZQosd+EgVQQ3C9gj0dApGtKqf2Ej7RNESwCPY8SOduTC6d8=
25
- # Release Engineering
26
- - secure: PmOaqp2DFyy79VpCuvSYILblK6tP0eDa9fDG9X2j+wggoosBkmlGfnSxp3A2TXlUyK62mr6/B89dRkL2aDWTJ/gqaZ34Elx2rV5S2A5YJIx9stA2+4iXeSlOF2YMNKGwBVmF/kp/nNoG2FqUkUBrRurWAOXZnwxKIhQ7+kLVb/0=
18
+ secure: udLCoBl71xJBsW3P+YqZbA5xfaB8l4IIF6SKEXpjIUYNYyP6m77uoY9PZ/M/5EN1ojPXDxsZ6SiPEJifVpkX5Hqd0eu1MwWyRXvOwiDf/nkg2Y3mqwUQRb3LDYWZxPn+xp5mHePe3mvTICR1zH49yx7fdZs8Qvzhh3Lno/w/qZ4=
@@ -1,5 +1,55 @@
1
1
  Omnibus CHANGELOG
2
2
  =================
3
+ v4.1.0 (September 1, 2015)
4
+ -------------------------
5
+ ### New Features
6
+ - Allow semver prefixes that start with "v"
7
+ - Reset target_shasum in PathFetcher after every fetch, preventing erroneous GitCache misses for builds that produced local artifacts during the previous omnibus run.
8
+ - Allow users to specify options to the underlying FileSyncer in a Software definition
9
+ - Add CPPFLAGS in with_standard_compiler_flags
10
+ - Add a Fedora dist tag to package name and spec release
11
+ - Copy distribution.xml.erb also when creating project with --pkg-assets
12
+ - Manage version manifests with Omnibus. Omnibus now creates a version manifest in text and JSON.
13
+ - Retry failed downloads
14
+ - Support inclusion of email address in Wix template
15
+ - Allow solaris to use mapfiles
16
+ - A new `omnibus generate changelog` command generates an opinionated CHANGELOG entry based on metadata in commit messages.
17
+ - Add warnings on empty globs.
18
+ - Raspberry Pi 2 support
19
+ - Clone git repositories with --recursive flag
20
+ - Add ability to sign MSIs
21
+ - Support running Omnibus with 64-bit ruby on Windows
22
+ - Create an Artifactory build for published packages
23
+ - Add a "windows_arch" omnibus option to choose 32/64 bit builds.
24
+ - Set directory ownership/permissions to match the filesystem package.
25
+ - Allow Windows 10 builders
26
+ - Allow omnibus to build "bundled" Windows installers
27
+ - Set perms on control files per Ubuntu Software Center's lintian checks.
28
+ - Replace uber-s3 dependency with aws-sdk
29
+
30
+ ### Bug Fixes
31
+ - Config.append_timestamp is now properly handled by the build_version
32
+ DSL. For some users, this may introduce a change in behavior. To
33
+ revert to the old behavior set append_timestamp to false in
34
+ `omnibus.rb` or use --override append_timestamp:false at the command
35
+ line.
36
+ - Do not memoize current_revision to avoid returning incorrect data. Memoizing current_revision was previously causing version_for_cache to return the pre-fetch revision of the software, leading us to erroneously restore an older revision from the cache.
37
+ - Clean up "files listed twice" warnings. This should allow signing RPMs on EL 7
38
+ - dpkg uses arch name ppc64el (instead of ppc64le) for little endian
39
+ - Override equality operator for ManifestEntry. Prior to this, we simply tested basic object identity, which would result in many "updated" dependencies
40
+ - Correctly determine git repository when running in a subdirectory
41
+ - Forcibly remove a non-empty project dir before cloning because if multiple projects are using the same maching for building, they might have two different software definitions that share the same name but a different source.
42
+ - Accomidate hardlinks properly
43
+ - When building spec file, handle path names that contain spaces
44
+ - Add libkvm and libprocstat to freebsd whitelist
45
+ - Properly render ERB templates that do not have variables
46
+ - Change git fetcher to correctly fetch when repo name is the same but branch/version is different.
47
+
48
+ ### Potentially Breaking Changes
49
+ - `Omnibus::SemanticVersion.new` now raises `Omnibus::InvalidVersion` instead of `Omnibus::SemanticVersion::InvalidVersion`
50
+ - Cache Builder#shasum before Builder#build to ensure consistent result.
51
+ - Update chef-sugar to 3.0 which adds ppc64le support.
52
+ - The MSI packager now adds the architecture to the msi name. The file names go from `package_name-build_version-build_iteration` to `package_name-build_version-build_iteration-arch`.
3
53
 
4
54
  v4.0.0 (December 15, 2014)
5
55
  --------------------------
@@ -0,0 +1,26 @@
1
+ # Maintainers
2
+
3
+ This file lists how the Omnibus project is maintained. When making changes
4
+ to the system, this file tells you who needs to review your patch - you need a
5
+ simple majority of maintainers for the relevant subsystems to provide a :+1: on
6
+ your pull request. Additionally, you need to not receive a veto from a
7
+ Lieutenant or the Project Lead.
8
+
9
+ Check out
10
+ [How Chef is Maintained](https://github.com/chef/chef-rfc/blob/master/rfc030-maintenance-policy.md#how-the-project-is-maintained)
11
+ for details on the process, how to become a maintainer, lieutenant, or the
12
+ project lead.
13
+
14
+ ## Project Lead
15
+
16
+ * [Seth Chisamore](https://github.com/schisamo)
17
+
18
+ ## Maintainers
19
+
20
+ * [Daniel DeLeo](https://github.com/danielsdeleo)
21
+ * [Jay Mundrawala](https://github.com/jdmundrawala)
22
+ * [Lamont Granquist](https://github.com/lamont-granquist)
23
+ * [Scott Hain](https://github.com/scotthain)
24
+ * [Seth Vargo](http://github.com/sethvargo)
25
+ * [Steven Danna](https://github.com/stevendanna)
26
+ * [Yvonne Lam](http://github.com/yzl)
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  ![Omnibus Icon](lib/omnibus/assets/README-logo.png) Omnibus
2
2
  ===========================================================
3
3
  [![Gem Version](http://img.shields.io/gem/v/omnibus.svg)][gem]
4
- [![Build Status](http://img.shields.io/travis/opscode/omnibus.svg)][travis]
4
+ [![Build Status](http://img.shields.io/travis/chef/omnibus.svg)][travis]
5
5
 
6
6
  [gem]: https://rubygems.org/gems/omnibus
7
- [travis]: http://travis-ci.org/opscode/omnibus
7
+ [travis]: http://travis-ci.org/chef/omnibus
8
8
 
9
9
  Easily create full-stack installers for your project across a variety of platforms.
10
10
 
@@ -19,7 +19,7 @@ Prerequisites
19
19
  -------------
20
20
  Omnibus is designed to run with a minimal set of prerequisites. You will need the following:
21
21
 
22
- - Ruby 1.9+
22
+ - Ruby 2.0.0+
23
23
  - Bundler
24
24
 
25
25
 
@@ -128,6 +128,11 @@ Some DSL methods available include:
128
128
  | `package` | Invoke a packager-specific DSL |
129
129
  | `compress` | Invoke a compressor-specific DSL |
130
130
 
131
+ By default a timestamp is appended to the build_version. You can turn
132
+ this behavior off by setting `append_timestamp` to `false` in your
133
+ configuration file or using `--override append_timestamp:false` at the
134
+ command line.
135
+
131
136
  For more information, please see the [`Project` documentation](http://rubydoc.info/github/opscode/omnibus/Omnibus/Project).
132
137
 
133
138
  ### Software
@@ -214,7 +219,7 @@ end
214
219
  Since the software definitions are simply ruby code, you can conditionally execute anything by wrapping it with pure Ruby that tests for the version number.
215
220
 
216
221
  #### Sharing software definitions
217
- The easiest way to share organization-wide software is via bundler and Rubygems. For an example software repository, look at Chef's [omnibus-software](https://github.com/opscode/omnibus-software). For more information, please see the [Rubygems documentation](http://guides.rubygems.org/publishing/).
222
+ The easiest way to share organization-wide software is via bundler and Rubygems. For an example software repository, look at Chef's [omnibus-software](https://github.com/chef/omnibus-software). For more information, please see the [Rubygems documentation](http://guides.rubygems.org/publishing/).
218
223
 
219
224
  It is recommended you use bundler to pull down these gems (as bundler also permits pulling software directly from GitHub):
220
225
 
@@ -248,6 +253,58 @@ $PWD/config/software/foo.rb
248
253
 
249
254
  The first instance of `foo.rb` that is encountered will be used. Please note that **local** (vendored) softare definitions take precedence!
250
255
 
256
+ Version Manifest
257
+ ----------------
258
+
259
+ Git-based software definitions may specify branches as their
260
+ default_version. In this case, the exact git revision to use will be
261
+ determined at build-time unless a project override (see below) or
262
+ external version manifest is used. To generate a version manifest use
263
+ the `omnibus manifest` command:
264
+
265
+ ```
266
+ omnibus manifest PROJECT -l warn
267
+ ```
268
+
269
+ This will output a JSON-formatted manifest containing the resolved
270
+ version of every software definition.
271
+
272
+ Whitelisting Libraries
273
+ ----------------------
274
+
275
+ Sometimes a platform has libraries that need to be whitelisted so the healthcheck
276
+ can pass. The whitelist found in the [healthcheck](https://github.com/chef/omnibus/blob/master/lib/omnibus/health_check.rb)
277
+ code comprises the minimal required for successful builds on supported platforms.
278
+
279
+ To add your own whitelisted library, simply add the a regex to your software
280
+ definition in your omnibus project as follows:
281
+ ```
282
+ whitelist_file /libpcrecpp\.so\..+/
283
+ ```
284
+ It is typically a good idea to add a conditional to whitelist based on the specific
285
+ platform that requires it.
286
+
287
+ *Warning: You should only add libraries to the whitelist that are guaranteed to
288
+ be on the system you install to; if a library comes from a non-default package
289
+ you should instead build it into the package.*
290
+
291
+ Changelog
292
+ ---------
293
+ STATUS: *EXPERIMENTAL*
294
+
295
+ `omnibus changelog generate` will generate a changelog for an omnibus
296
+ project. This command currently assumes:
297
+
298
+ - version-manifest.json is checked into the project root
299
+ - the project is a git repository
300
+ - each version is tagged with a SemVer compliant annotated tag
301
+ - Any git-based sources are checked out at ../COMPONENT_NAME
302
+ - Any commit message line prepended with ChangeLog-Entry: should be
303
+ added to the changelog.
304
+
305
+ These assumptions *will* change as we determine what works best for a
306
+ number of our projects.
307
+
251
308
 
252
309
  Caveats
253
310
  -------
@@ -0,0 +1,35 @@
1
+ version: "{build}"
2
+
3
+ os: Windows Server 2012
4
+ platform:
5
+ - x64
6
+
7
+ environment:
8
+ matrix:
9
+ - ruby_version: "200"
10
+
11
+ clone_folder: c:\projects\omnibus
12
+ clone_depth: 1
13
+ skip_tags: true
14
+ branches:
15
+ only:
16
+ - master
17
+
18
+ install:
19
+ - SET PATH=C:\Ruby%ruby_version%\bin;C:\Ruby21%ruby_version:~3%\Devkit\mingw\bin;%PATH%
20
+ - echo %PATH%
21
+ - ruby --version
22
+ - gem --version
23
+ - gem install bundler --quiet --no-ri --no-rdoc
24
+ - bundler --version
25
+ - cp C:\Ruby21%ruby_version:~3%\Devkit\mingw\bin\bsdtar.exe C:\Ruby21%ruby_version:~3%\Devkit\mingw\bin\tar.exe
26
+ - appveyor DownloadFile http://curl.haxx.se/ca/cacert.pem -FileName C:\cacert.pem
27
+ - set SSL_CERT_FILE=C:\cacert.pem
28
+
29
+ build_script:
30
+ - bundle install
31
+
32
+ test_script:
33
+ - bundle exec rake unit
34
+ - bundle exec rake functional
35
+ - bundle exec rake acceptance
@@ -22,7 +22,7 @@ repository) is
22
22
  customize the location of the cache in the `omnibus.rb` config file
23
23
  using the key `git_cache_dir`. For example:
24
24
 
25
- git_cache_dir "/opt/ominbus-caches"
25
+ git_cache_dir "/opt/omnibus-caches"
26
26
 
27
27
  ## How It Works ##
28
28
 
@@ -67,8 +67,33 @@ You can inspect the cache keys like this:
67
67
  git --git-dir=$CACHE_PATH tag -l
68
68
 
69
69
  You can manually remove a cache entry using `git tag --delete
70
- $TAG`. In theory, you can share the cache among build slaves using
71
- `git clone/fetch`.
70
+ $TAG`.
71
+
72
+
73
+ ## Build Slaves ##
74
+
75
+ You can share the cache among build slaves using `git clone/fetch`.
76
+
77
+ Using git bundles is another option (if you're using Jenkins, the bundle
78
+ can be persisted as an artifact):
79
+
80
+ + Backup: `git --git-dir=$CACHE_PATH bundle create $CACHE_BUNDLE --tags`
81
+ + Restore: `git clone --mirror $CACHE_BUNDLE $CACHE_PATH`
82
+
83
+ (CACHE_BUNDLE is anywhere you're persisting the bundle to)
84
+
85
+
86
+ ### Important Caveat ###
87
+
88
+ Note that Omnibus caches instructions *exactly as they will be executed*
89
+ (e.g. Omnibus caches `make -j 9`, it doesn't cache `make -j #{workers}`).
90
+
91
+ So, if you intend to share your build cache among slaves, you should ensure
92
+ that their build environments are identical (failing which you'll bust the
93
+ cache with commands that depend on the environment).
94
+
95
+
96
+ ## Mac OS X Caveats ##
72
97
 
73
98
  When running a build vm on OS X, note that you will likely run into
74
99
  trouble if you attempt to locate your cache on your local
@@ -65,7 +65,7 @@ Some DSL methods available include:
65
65
  | `vendor` | The name of the package producer |
66
66
  | `license` | The default license for the package |
67
67
  | `priority` | The priority for the package |
68
- | `catetory` | The catetory for this package |
68
+ | `category` | The category for this package |
69
69
 
70
70
  If you are unfamilar with any of these terms, you should just accept the defaults. For more information on the purpose of any of these configuration options, please see the RPM spec.
71
71
 
@@ -1,13 +1,8 @@
1
1
  Feature: omnibus publish
2
- Scenario: Overriding publishing platform
3
- * I run `omnibus publish artifactory fake * --platform debian`
2
+ Scenario: Providing platform mappings file
3
+ * I have a platform mappings file named "platform_mappings.json"
4
+ * I run `omnibus publish artifactory fake * --platform-mappings platform_mappings.json`
4
5
  * the output should contain:
5
6
  """
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'
7
+ Publishing will be performed using provided platform mappings.
13
8
  """
@@ -1,7 +1,7 @@
1
1
  require 'aruba/api'
2
2
 
3
3
  Given(/^I have an omnibus project named "(.+)"$/) do |name|
4
- create_dir(name)
4
+ create_directory(name)
5
5
  cd(name)
6
6
 
7
7
  write_file("config/projects/#{name}.rb", <<-EOH.gsub(/^ {4}/, ''))
@@ -18,6 +18,7 @@ Given(/^I have an omnibus project named "(.+)"$/) do |name|
18
18
 
19
19
  write_file('omnibus.rb', <<-EOH.gsub(/^ {4}/, ''))
20
20
  # Build configuration
21
+ append_timestamp false
21
22
  cache_dir './local/omnibus/cache'
22
23
  git_cache_dir './local/omnibus/cache/git_cache'
23
24
  source_dir './local/omnibus/src'
@@ -26,3 +27,15 @@ Given(/^I have an omnibus project named "(.+)"$/) do |name|
26
27
  package_tmp './local/omnibus/pkg-tmp'
27
28
  EOH
28
29
  end
30
+
31
+ Given(/^I have a platform mappings file named "(.+)"$/) do |name|
32
+ write_file(name, <<-EOH.gsub(/^ {4}/, ''))
33
+ {
34
+ "ubuntu-10.04": [
35
+ "ubuntu-10.04",
36
+ "ubuntu-12.04",
37
+ "ubuntu-14.04"
38
+ ]
39
+ }
40
+ EOH
41
+ end
@@ -4,10 +4,12 @@ require 'aruba/in_process'
4
4
 
5
5
  require 'omnibus/cli'
6
6
 
7
+ Aruba.configure do |config|
8
+ config.command_launcher = :in_process
9
+ config.main_class = Omnibus::CLI::Runner
10
+ end
11
+
7
12
  Before do
8
13
  # Reset anything that might have been cached in the Omnibus project
9
14
  Omnibus.reset!(true)
10
-
11
- Aruba::InProcess.main_class = Omnibus::CLI::Runner
12
- Aruba.process = Aruba::InProcess
13
15
  end
@@ -72,10 +72,20 @@ module Omnibus
72
72
  autoload :NullPublisher, 'omnibus/publishers/null_publisher'
73
73
  autoload :S3Publisher, 'omnibus/publishers/s3_publisher'
74
74
 
75
+ autoload :Manifest, 'omnibus/manifest'
76
+ autoload :ManifestEntry, 'omnibus/manifest_entry'
77
+ autoload :ManifestDiff, 'omnibus/manifest_diff'
78
+
79
+ autoload :ChangeLog, 'omnibus/changelog'
80
+ autoload :GitRepository, 'omnibus/git_repository'
81
+
82
+ autoload :SemanticVersion, 'omnibus/semantic_version'
83
+
75
84
  module Command
76
85
  autoload :Base, 'omnibus/cli/base'
77
86
  autoload :Cache, 'omnibus/cli/cache'
78
87
  autoload :Publish, 'omnibus/cli/publish'
88
+ autoload :ChangeLog, 'omnibus/cli/changelog'
79
89
  end
80
90
 
81
91
  class << self
@@ -46,6 +46,10 @@ module Omnibus
46
46
  def semver
47
47
  new.semver
48
48
  end
49
+
50
+ def build_start_time
51
+ new.build_start_time
52
+ end
49
53
  end
50
54
 
51
55
  # Create a new BuildVersion
@@ -102,7 +106,7 @@ module Omnibus
102
106
  #
103
107
  # format: YYYYMMDDHHMMSS example: 20130131123345
104
108
  if Config.append_timestamp
105
- build_version_items << build_start_time.strftime(TIMESTAMP_FORMAT)
109
+ build_version_items << build_start_time
106
110
  end
107
111
 
108
112
  # We'll append the git describe information unless we are sitting right
@@ -120,6 +124,26 @@ module Omnibus
120
124
  build_tag
121
125
  end
122
126
 
127
+ # We'll attempt to retrive the timestamp from the Jenkin's set BUILD_ID
128
+ # environment variable. This will ensure platform specfic packages for the
129
+ # same build will share the same timestamp.
130
+ def build_start_time
131
+ @build_start_time ||= begin
132
+ if ENV['BUILD_ID']
133
+ begin
134
+ Time.strptime(ENV['BUILD_ID'], '%Y-%m-%d_%H-%M-%S')
135
+ rescue ArgumentError
136
+ error_message = 'BUILD_ID environment variable '
137
+ error_message << 'should be in YYYY-MM-DD_hh-mm-ss '
138
+ error_message << 'format.'
139
+ raise ArgumentError, error_message
140
+ end
141
+ else
142
+ Time.now.utc
143
+ end
144
+ end.strftime(TIMESTAMP_FORMAT)
145
+ end
146
+
123
147
  # Generates a version string by running
124
148
  # {https://www.kernel.org/pub/software/scm/git/docs/git-describe.html
125
149
  # git describe} in the root of the Omnibus project.
@@ -179,9 +203,9 @@ module Omnibus
179
203
  # @return [nil] if no pre-release tag was found
180
204
  def prerelease_tag
181
205
  prerelease_regex = if commits_since_tag > 0
182
- /^\d+\.\d+\.\d+(?:-|\.)([0-9A-Za-z.-]+)-\d+-g[0-9a-f]+$/
206
+ /^v?\d+\.\d+\.\d+(?:-|\.)([0-9A-Za-z.-]+)-\d+-g[0-9a-f]+$/
183
207
  else
184
- /^\d+\.\d+\.\d+(?:-|\.)([0-9A-Za-z.-]+)$/
208
+ /^v?\d+\.\d+\.\d+(?:-|\.)([0-9A-Za-z.-]+)$/
185
209
  end
186
210
  match = prerelease_regex.match(git_describe)
187
211
  match ? match[1] : nil
@@ -237,26 +261,6 @@ module Omnibus
237
261
 
238
262
  private
239
263
 
240
- # We'll attempt to retrive the timestamp from the Jenkin's set BUILD_ID
241
- # environment variable. This will ensure platform specfic packages for the
242
- # same build will share the same timestamp.
243
- def build_start_time
244
- @build_start_time ||= begin
245
- if ENV['BUILD_ID']
246
- begin
247
- Time.strptime(ENV['BUILD_ID'], '%Y-%m-%d_%H-%M-%S')
248
- rescue ArgumentError
249
- error_message = 'BUILD_ID environment variable '
250
- error_message << 'should be in YYYY-MM-DD_hh-mm-ss '
251
- error_message << 'format.'
252
- raise ArgumentError, error_message
253
- end
254
- else
255
- Time.now.utc
256
- end
257
- end
258
- end
259
-
260
264
  # Pulls out the major, minor, and patch components from the output
261
265
  # of {#git_describe}.
262
266
  #
@@ -267,8 +271,13 @@ module Omnibus
267
271
  #
268
272
  # @todo Compute this once and store the result in an instance variable
269
273
  def version_composition
270
- version_regexp = /^(\d+)\.(\d+)\.(\d+)/
271
- version_regexp.match(git_describe)[1..3]
274
+ version_regexp = /^v?(\d+)\.(\d+)\.(\d+)/
275
+
276
+ if match = version_regexp.match(git_describe)
277
+ match[1..3]
278
+ else
279
+ raise "Invalid semver tag `#{git_describe}'!"
280
+ end
272
281
  end
273
282
  end
274
283
  end