omnibus 5.4.0 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/CHANGELOG.md +21 -0
- data/Gemfile +8 -5
- data/README.md +3 -1
- data/Rakefile +20 -13
- data/appveyor.yml +4 -3
- data/bin/omnibus +3 -3
- data/features/commands/manifest.feature +19 -5
- data/features/step_definitions/generator_steps.rb +5 -6
- data/features/support/env.rb +4 -4
- data/lib/omnibus/build_version.rb +14 -14
- data/lib/omnibus/build_version_dsl.rb +3 -3
- data/lib/omnibus/builder.rb +50 -61
- data/lib/omnibus/changelog.rb +2 -2
- data/lib/omnibus/changelog_printer.rb +4 -4
- data/lib/omnibus/cleaner.rb +4 -4
- data/lib/omnibus/cli/base.rb +15 -15
- data/lib/omnibus/cli/cache.rb +13 -13
- data/lib/omnibus/cli/changelog.rb +8 -9
- data/lib/omnibus/cli/publish.rb +12 -13
- data/lib/omnibus/cli.rb +26 -27
- data/lib/omnibus/compressor.rb +6 -6
- data/lib/omnibus/compressors/base.rb +7 -2
- data/lib/omnibus/compressors/dmg.rb +12 -12
- data/lib/omnibus/compressors/null.rb +1 -1
- data/lib/omnibus/compressors/tgz.rb +8 -8
- data/lib/omnibus/config.rb +37 -26
- data/lib/omnibus/core_extensions/open_uri.rb +3 -3
- data/lib/omnibus/core_extensions.rb +1 -1
- data/lib/omnibus/digestable.rb +5 -4
- data/lib/omnibus/download_helpers.rb +7 -6
- data/lib/omnibus/exceptions.rb +29 -13
- data/lib/omnibus/fetcher.rb +0 -1
- data/lib/omnibus/fetchers/git_fetcher.rb +7 -7
- data/lib/omnibus/fetchers/net_fetcher.rb +19 -19
- data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
- data/lib/omnibus/file_syncer.rb +3 -3
- data/lib/omnibus/generator.rb +60 -47
- data/lib/omnibus/git_cache.rb +33 -22
- data/lib/omnibus/git_repository.rb +5 -5
- data/lib/omnibus/health_check.rb +122 -119
- data/lib/omnibus/instrumentation.rb +1 -1
- data/lib/omnibus/licensing.rb +348 -60
- data/lib/omnibus/logger.rb +12 -9
- data/lib/omnibus/logging.rb +1 -1
- data/lib/omnibus/manifest.rb +4 -4
- data/lib/omnibus/manifest_diff.rb +6 -7
- data/lib/omnibus/manifest_entry.rb +1 -1
- data/lib/omnibus/metadata.rb +36 -36
- data/lib/omnibus/ohai.rb +6 -7
- data/lib/omnibus/package.rb +1 -1
- data/lib/omnibus/packager.rb +37 -28
- data/lib/omnibus/packagers/appx.rb +86 -0
- data/lib/omnibus/packagers/base.rb +21 -18
- data/lib/omnibus/packagers/bff.rb +22 -24
- data/lib/omnibus/packagers/deb.rb +20 -20
- data/lib/omnibus/packagers/ips.rb +18 -17
- data/lib/omnibus/packagers/makeself.rb +7 -7
- data/lib/omnibus/packagers/msi.rb +38 -193
- data/lib/omnibus/packagers/pkg.rb +16 -16
- data/lib/omnibus/packagers/rpm.rb +53 -54
- data/lib/omnibus/packagers/solaris.rb +14 -14
- data/lib/omnibus/packagers/windows_base.rb +192 -0
- data/lib/omnibus/project.rb +45 -43
- data/lib/omnibus/publisher.rb +3 -3
- data/lib/omnibus/publishers/artifactory_publisher.rb +39 -39
- data/lib/omnibus/publishers/s3_publisher.rb +7 -7
- data/lib/omnibus/reports.rb +10 -10
- data/lib/omnibus/s3_cache.rb +7 -7
- data/lib/omnibus/s3_helpers.rb +8 -7
- data/lib/omnibus/semantic_version.rb +1 -1
- data/lib/omnibus/software.rb +131 -81
- data/lib/omnibus/sugarable.rb +10 -10
- data/lib/omnibus/templating.rb +5 -5
- data/lib/omnibus/thread_pool.rb +1 -1
- data/lib/omnibus/util.rb +5 -5
- data/lib/omnibus/version.rb +1 -1
- data/lib/omnibus.rb +65 -65
- data/omnibus.gemspec +34 -32
- data/resources/appx/AppxManifest.xml.erb +18 -0
- data/resources/appx/assets/clear.png +0 -0
- data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-bundler-audit-0.5.0-COPYING.txt +674 -0
- data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-inifile-3.0.0-README.md +215 -0
- data/spec/fixtures/licensing/license_scout/snoopy/snoopy-dependency-licenses.json +24 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-inifile-3.0.0-README.md +215 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mime-types-3.1-Licence.rdoc +25 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mini_portile2-2.1.0-LICENSE.txt +20 -0
- data/spec/fixtures/licensing/license_scout/zlib/zlib-dependency-licenses.json +32 -0
- data/spec/functional/builder_spec.rb +149 -150
- data/spec/functional/fetchers/git_fetcher_spec.rb +69 -71
- data/spec/functional/fetchers/net_fetcher_spec.rb +79 -79
- data/spec/functional/fetchers/path_fetcher_spec.rb +19 -20
- data/spec/functional/file_syncer_spec.rb +74 -74
- data/spec/functional/licensing_spec.rb +344 -35
- data/spec/functional/templating_spec.rb +17 -17
- data/spec/spec_helper.rb +20 -20
- data/spec/support/examples.rb +21 -15
- data/spec/support/file_helpers.rb +1 -1
- data/spec/support/git_helpers.rb +37 -37
- data/spec/support/matchers.rb +3 -3
- data/spec/support/ohai_helpers.rb +4 -4
- data/spec/support/path_helpers.rb +2 -2
- data/spec/support/shell_helpers.rb +2 -2
- data/spec/unit/build_version_dsl_spec.rb +5 -5
- data/spec/unit/build_version_spec.rb +63 -63
- data/spec/unit/builder_spec.rb +86 -70
- data/spec/unit/changelog_spec.rb +4 -4
- data/spec/unit/changelogprinter_spec.rb +130 -0
- data/spec/unit/cleanroom_spec.rb +11 -11
- data/spec/unit/compressor_spec.rb +16 -16
- data/spec/unit/compressors/base_spec.rb +6 -6
- data/spec/unit/compressors/dmg_spec.rb +76 -76
- data/spec/unit/compressors/null_spec.rb +4 -4
- data/spec/unit/compressors/tgz_spec.rb +20 -20
- data/spec/unit/config_spec.rb +44 -43
- data/spec/unit/digestable_spec.rb +13 -13
- data/spec/unit/fetcher_spec.rb +11 -12
- data/spec/unit/fetchers/git_fetcher_spec.rb +31 -31
- data/spec/unit/fetchers/net_fetcher_spec.rb +172 -173
- data/spec/unit/fetchers/path_fetcher_spec.rb +18 -18
- data/spec/unit/generator_spec.rb +38 -38
- data/spec/unit/git_cache_spec.rb +56 -54
- data/spec/unit/git_repository_spec.rb +2 -2
- data/spec/unit/health_check_spec.rb +40 -40
- data/spec/unit/library_spec.rb +35 -35
- data/spec/unit/manifest_diff_spec.rb +10 -11
- data/spec/unit/manifest_spec.rb +17 -17
- data/spec/unit/metadata_spec.rb +152 -152
- data/spec/unit/ohai_spec.rb +5 -5
- data/spec/unit/omnibus_spec.rb +31 -31
- data/spec/unit/package_spec.rb +20 -20
- data/spec/unit/packager_spec.rb +48 -42
- data/spec/unit/packagers/appx_spec.rb +165 -0
- data/spec/unit/packagers/base_spec.rb +34 -34
- data/spec/unit/packagers/bff_spec.rb +60 -60
- data/spec/unit/packagers/deb_spec.rb +71 -71
- data/spec/unit/packagers/ips_spec.rb +45 -45
- data/spec/unit/packagers/makeself_spec.rb +22 -22
- data/spec/unit/packagers/msi_spec.rb +141 -147
- data/spec/unit/packagers/pkg_spec.rb +59 -60
- data/spec/unit/packagers/rpm_spec.rb +125 -126
- data/spec/unit/packagers/solaris_spec.rb +52 -52
- data/spec/unit/project_spec.rb +137 -135
- data/spec/unit/publisher_spec.rb +70 -70
- data/spec/unit/publishers/artifactory_publisher_spec.rb +85 -85
- data/spec/unit/publishers/s3_publisher_spec.rb +36 -36
- data/spec/unit/s3_cacher_spec.rb +34 -34
- data/spec/unit/s3_helpers_spec.rb +6 -6
- data/spec/unit/semantic_version_spec.rb +2 -2
- data/spec/unit/software_spec.rb +346 -384
- data/spec/unit/sugarable_spec.rb +10 -10
- data/spec/unit/util_spec.rb +60 -60
- metadata +54 -6
- data/.rubocop.yml +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df89be1587ea0dd7f53b9d049fd0b98e59303696
|
4
|
+
data.tar.gz: 3dbf3e7857bfd275f4d35e04d1b2522259a82f01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73d9cf647ab0734f4e13797ae98f7baff5d1f03011bcd826c291cab03f8fd4c7448fc8328d903211a675b1b023034b84d84a2bd85f304c901e9cc47b6f88fcba
|
7
|
+
data.tar.gz: 895ab544f10c0cd284965c21c586c30b439ba679f1898b14d1f72671d91c21de43eca176141cdb681f9e8c18de8b93ea9b4e7d62eeb316fa4175fb0f50bbefbf
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,27 @@
|
|
1
1
|
Omnibus CHANGELOG
|
2
2
|
=================
|
3
3
|
|
4
|
+
v5.5.0 (August 16, 2016)
|
5
|
+
-----------------------
|
6
|
+
### New Features
|
7
|
+
- Add build timings to the local output (#669)
|
8
|
+
- Add `appx` packager (#675, #676, #677)
|
9
|
+
- `fatal_licensing_warnings` configuration to fail the build when there are licensing problems (#678)
|
10
|
+
- Ensure consistent code style using Chefstyle \o/ (#681)
|
11
|
+
- Drop Ruby 2.0 support (#697)
|
12
|
+
- Remove fakeroot from RPM packager (#698)
|
13
|
+
- Support license collection with git cache (#700)
|
14
|
+
- Add `SERIAL_NUMBER` to omnibus code, which is used in git caching to invalidate caches when omnibus code changes require it to be invalidated (#704)
|
15
|
+
- Support license collection of transitive dependencies (via license_scout gem) (#705)
|
16
|
+
- Add `skip_transitive_dependency_licensing` dsl method to Software. Use this when the software does not use any dependency manager. (#705)
|
17
|
+
|
18
|
+
### Bug Fixes
|
19
|
+
- Make license files readable inside the packages (#673)
|
20
|
+
- Prefer server marketing names on windows (#679)
|
21
|
+
- Instead of exe, use bat if present on windows (#684)
|
22
|
+
- Fix changelog generation with symbolized keys (#687)
|
23
|
+
|
24
|
+
|
4
25
|
v5.4.0 (April 18, 2016)
|
5
26
|
-----------------------
|
6
27
|
### New Features
|
data/Gemfile
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
gemspec
|
3
3
|
|
4
4
|
# Fork to allow for a recent version of multipart-post.
|
5
|
-
gem
|
5
|
+
gem "pedump", git: "https://github.com/ksubrama/pedump", branch: "patch-1"
|
6
|
+
|
7
|
+
# Always use license_scout from master
|
8
|
+
gem "license_scout", github: "chef/license_scout"
|
6
9
|
|
7
10
|
group :docs do
|
8
|
-
gem
|
9
|
-
gem
|
10
|
-
gem
|
11
|
+
gem "yard", "~> 0.8"
|
12
|
+
gem "redcarpet", "~> 2.2.2"
|
13
|
+
gem "github-markup", "~> 0.7"
|
11
14
|
end
|
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
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/chef/omnibus.svg)][travis]
|
4
|
+
[![Travis Build Status](http://img.shields.io/travis/chef/omnibus.svg?label=Travis CI)][travis]
|
5
|
+
[![AppVeyor Build Status](http://img.shields.io/appveyor/ci/chef/omnibus.svg?label=AppVeyor)][appveyor]
|
5
6
|
|
6
7
|
[gem]: https://rubygems.org/gems/omnibus
|
7
8
|
[travis]: https://travis-ci.org/chef/omnibus
|
9
|
+
[appveyor]: https://ci.appveyor.com/project/chef/omnibus
|
8
10
|
|
9
11
|
Easily create full-stack installers for your project across a variety of platforms.
|
10
12
|
|
data/Rakefile
CHANGED
@@ -1,28 +1,35 @@
|
|
1
|
-
require
|
1
|
+
require "bundler/gem_tasks"
|
2
2
|
|
3
|
-
require
|
3
|
+
require "rspec/core/rake_task"
|
4
4
|
[:unit, :functional].each do |type|
|
5
5
|
RSpec::Core::RakeTask.new(type) do |t|
|
6
6
|
t.pattern = "spec/#{type}/**/*_spec.rb"
|
7
7
|
t.rspec_opts = [].tap do |a|
|
8
|
-
a.push(
|
9
|
-
a.push(
|
10
|
-
end.join(
|
8
|
+
a.push("--color")
|
9
|
+
a.push("--format progress")
|
10
|
+
end.join(" ")
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
require
|
14
|
+
require "cucumber/rake/task"
|
15
15
|
Cucumber::Rake::Task.new(:acceptance) do |t|
|
16
16
|
t.cucumber_opts = [].tap do |a|
|
17
|
-
a.push(
|
18
|
-
a.push(
|
19
|
-
a.push(
|
20
|
-
end.join(
|
17
|
+
a.push("--color")
|
18
|
+
a.push("--format progress")
|
19
|
+
a.push("--strict")
|
20
|
+
end.join(" ")
|
21
|
+
end
|
22
|
+
|
23
|
+
require "chefstyle"
|
24
|
+
require "rubocop/rake_task"
|
25
|
+
desc " Run ChefStyle"
|
26
|
+
RuboCop::RakeTask.new(:chefstyle) do |task|
|
27
|
+
task.options << "--display-cop-names"
|
21
28
|
end
|
22
29
|
|
23
30
|
namespace :travis do
|
24
|
-
desc
|
25
|
-
task ci: %w
|
31
|
+
desc "Run tests on Travis"
|
32
|
+
task ci: %w{chefstyle unit functional acceptance}
|
26
33
|
end
|
27
34
|
|
28
|
-
task default: %w
|
35
|
+
task default: %w{travis:ci}
|
data/appveyor.yml
CHANGED
@@ -6,7 +6,8 @@ platform:
|
|
6
6
|
|
7
7
|
environment:
|
8
8
|
matrix:
|
9
|
-
-
|
9
|
+
- RUBY_VERSION: 22
|
10
|
+
- RUBY_VERSION: 21
|
10
11
|
|
11
12
|
clone_folder: c:\projects\omnibus
|
12
13
|
clone_depth: 1
|
@@ -16,13 +17,13 @@ branches:
|
|
16
17
|
- master
|
17
18
|
|
18
19
|
install:
|
19
|
-
- SET PATH=C:\Ruby%
|
20
|
+
- SET PATH=C:\Ruby%RUBY_VERSION%\bin;C:\Ruby23-x64\DevKit\mingw\bin;%PATH%
|
20
21
|
- echo %PATH%
|
21
22
|
- ruby --version
|
22
23
|
- gem --version
|
23
24
|
- gem install bundler -v 1.10.6 --quiet --no-ri --no-rdoc
|
24
25
|
- bundler --version
|
25
|
-
- cp C:\
|
26
|
+
- cp C:\Ruby23-x64\DevKit\mingw\bin\bsdtar.exe C:\Ruby23-x64\DevKit\mingw\bin\tar.exe
|
26
27
|
- appveyor DownloadFile http://curl.haxx.se/ca/cacert.pem -FileName C:\cacert.pem
|
27
28
|
- set SSL_CERT_FILE=C:\cacert.pem
|
28
29
|
- git config --global user.email "clouseau@chef.io"
|
data/bin/omnibus
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
|
3
3
|
# Trap interrupts to quit cleanly. See
|
4
4
|
# https://twitter.com/mitchellh/status/283014103189053442
|
5
|
-
Signal.trap(
|
5
|
+
Signal.trap("INT") { exit 1 }
|
6
6
|
|
7
|
-
$:.push File.expand_path(
|
7
|
+
$:.push File.expand_path("../../lib", __FILE__)
|
8
8
|
$stdout.sync = true
|
9
9
|
|
10
|
-
require
|
10
|
+
require "omnibus/cli"
|
11
11
|
|
12
12
|
# Some platforms do not have a UTF-8 locale, so we need to enforce one
|
13
13
|
# or else the cacert chain will break among other things
|
@@ -14,7 +14,10 @@ Feature: omnibus manifest
|
|
14
14
|
Scenario: When the project has no software definitions
|
15
15
|
When I run `omnibus manifest hamlet`
|
16
16
|
|
17
|
-
Then it should pass with "[Project: hamlet] I |
|
17
|
+
Then it should pass with "[Project: hamlet] I | "
|
18
|
+
|
19
|
+
And the output should match /^[Project: hamlet] I | \d\d\d\d-[0-1]\d-[0-3]\dT[0-2]\d:[0-6]\d:[0-6]\d(\+|\-)\d\d:\d\d | Building version manifest$/
|
20
|
+
|
18
21
|
And the output should contain:
|
19
22
|
"""
|
20
23
|
"software": {
|
@@ -35,7 +38,9 @@ Feature: omnibus manifest
|
|
35
38
|
|
36
39
|
When I run `omnibus manifest hamlet`
|
37
40
|
|
38
|
-
Then it should pass with "[Project: hamlet] I |
|
41
|
+
Then it should pass with "[Project: hamlet] I | "
|
42
|
+
|
43
|
+
And the output should match /^[Project: hamlet] I | \d\d\d\d-[0-1]\d-[0-3]\dT[0-2]\d:[0-6]\d:[0-6]\d(\+|\-)\d\d:\d\d | Building version manifest$/
|
39
44
|
And the output should contain:
|
40
45
|
"""
|
41
46
|
"software": {
|
@@ -62,7 +67,10 @@ Feature: omnibus manifest
|
|
62
67
|
|
63
68
|
When I run `omnibus manifest hamlet`
|
64
69
|
|
65
|
-
Then it should pass with "[Project: hamlet] I |
|
70
|
+
Then it should pass with "[Project: hamlet] I | "
|
71
|
+
|
72
|
+
And the output should match /^[Project: hamlet] I | \d\d\d\d-[0-1]\d-[0-3]\dT[0-2]\d:[0-6]\d:[0-6]\d(\+|\-)\d\d:\d\d | Building version manifest$/
|
73
|
+
|
66
74
|
And the output should contain:
|
67
75
|
"""
|
68
76
|
"software": {
|
@@ -90,7 +98,10 @@ Feature: omnibus manifest
|
|
90
98
|
|
91
99
|
When I run `omnibus manifest hamlet --os=linux --platform_family=debian --platform=ubuntu --platform_version=14.04`
|
92
100
|
|
93
|
-
Then it should pass with "[Project: hamlet] I
|
101
|
+
Then it should pass with "[Project: hamlet] I "
|
102
|
+
|
103
|
+
And the output should match /^[Project: hamlet] I | \d\d\d\d-[0-1]\d-[0-3]\dT[0-2]\d:[0-6]\d:[0-6]\d(\+|\-)\d\d:\d\d | Building version manifest$/
|
104
|
+
|
94
105
|
And the output should contain:
|
95
106
|
"""
|
96
107
|
"software": {
|
@@ -117,7 +128,10 @@ Feature: omnibus manifest
|
|
117
128
|
|
118
129
|
When I run `omnibus manifest hamlet --os=windows --platform_family=windows --platform=windows --platform_version=2012r2`
|
119
130
|
|
120
|
-
Then it should pass with "[Project: hamlet] I |
|
131
|
+
Then it should pass with "[Project: hamlet] I | "
|
132
|
+
|
133
|
+
And the output should match /^[Project: hamlet] I | \d\d\d\d-[0-1]\d-[0-3]\dT[0-2]\d:[0-6]\d:[0-6]\d(\+|\-)\d\d:\d\d | Building version manifest$/
|
134
|
+
|
121
135
|
And the output should contain:
|
122
136
|
"""
|
123
137
|
"software": {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "aruba/api"
|
2
2
|
|
3
3
|
Given(/^I have an omnibus project named "(.+)"$/) do |name|
|
4
4
|
create_directory(name)
|
@@ -10,7 +10,7 @@ Given(/^I have an omnibus project named "(.+)"$/) do |name|
|
|
10
10
|
# Single top level output dir
|
11
11
|
create_directory("output")
|
12
12
|
|
13
|
-
write_file("config/projects/#{name}.rb", <<-EOH.gsub(/^ {4}/,
|
13
|
+
write_file("config/projects/#{name}.rb", <<-EOH.gsub(/^ {4}/, ""))
|
14
14
|
name '#{name}'
|
15
15
|
maintainer 'Mrs. Maintainer'
|
16
16
|
homepage 'https://example.com'
|
@@ -27,7 +27,7 @@ Given(/^I have an omnibus project named "(.+)"$/) do |name|
|
|
27
27
|
end
|
28
28
|
EOH
|
29
29
|
|
30
|
-
write_file(
|
30
|
+
write_file("omnibus.rb", <<-EOH.gsub(/^ {4}/, ""))
|
31
31
|
# Build configuration
|
32
32
|
append_timestamp false
|
33
33
|
cache_dir '#{abs_path}/local/omnibus/cache'
|
@@ -40,12 +40,11 @@ Given(/^I have an omnibus project named "(.+)"$/) do |name|
|
|
40
40
|
end
|
41
41
|
|
42
42
|
Given(/^I debug$/) do
|
43
|
-
require
|
44
|
-
binding.pry
|
43
|
+
require "pry"
|
45
44
|
end
|
46
45
|
|
47
46
|
Given(/^I have a platform mappings file named "(.+)"$/) do |name|
|
48
|
-
write_file(name, <<-EOH.gsub(/^ {4}/,
|
47
|
+
write_file(name, <<-EOH.gsub(/^ {4}/, ""))
|
49
48
|
{
|
50
49
|
"ubuntu-10.04": [
|
51
50
|
"ubuntu-10.04",
|
data/features/support/env.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "aruba"
|
2
|
+
require "aruba/cucumber"
|
3
|
+
require "aruba/in_process"
|
4
4
|
|
5
|
-
require
|
5
|
+
require "omnibus/cli"
|
6
6
|
|
7
7
|
Aruba.configure do |config|
|
8
8
|
config.command_launcher = :in_process
|
@@ -14,7 +14,7 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
require
|
17
|
+
require "time"
|
18
18
|
|
19
19
|
module Omnibus
|
20
20
|
# Provides methods for generating Omnibus project build version
|
@@ -34,7 +34,7 @@ module Omnibus
|
|
34
34
|
#
|
35
35
|
# @see Omnibus::BuildVersion#semver
|
36
36
|
# @see Time#strftime
|
37
|
-
TIMESTAMP_FORMAT =
|
37
|
+
TIMESTAMP_FORMAT = "%Y%m%d%H%M%S"
|
38
38
|
|
39
39
|
class << self
|
40
40
|
# @see (BuildVersion#git_describe)
|
@@ -92,8 +92,8 @@ module Omnibus
|
|
92
92
|
if prerelease_version?
|
93
93
|
# ensure all dashes are dots per precedence rules (#12) in Semver
|
94
94
|
# 2.0.0-rc.1
|
95
|
-
prerelease = prerelease_tag.
|
96
|
-
build_tag <<
|
95
|
+
prerelease = prerelease_tag.tr("-", ".")
|
96
|
+
build_tag << "-" << prerelease
|
97
97
|
end
|
98
98
|
|
99
99
|
# BUILD VERSION
|
@@ -114,11 +114,11 @@ module Omnibus
|
|
114
114
|
#
|
115
115
|
# format: git.COMMITS_SINCE_TAG.GIT_SHA example: git.207.694b062
|
116
116
|
unless commits_since_tag == 0
|
117
|
-
build_version_items << [
|
117
|
+
build_version_items << ["git", commits_since_tag, git_sha_tag].join(".")
|
118
118
|
end
|
119
119
|
|
120
120
|
unless build_version_items.empty?
|
121
|
-
build_tag <<
|
121
|
+
build_tag << "+" << build_version_items.join(".")
|
122
122
|
end
|
123
123
|
|
124
124
|
build_tag
|
@@ -129,13 +129,13 @@ module Omnibus
|
|
129
129
|
# same build will share the same timestamp.
|
130
130
|
def build_start_time
|
131
131
|
@build_start_time ||= begin
|
132
|
-
if ENV[
|
132
|
+
if ENV["BUILD_ID"]
|
133
133
|
begin
|
134
|
-
Time.strptime(ENV[
|
134
|
+
Time.strptime(ENV["BUILD_ID"], "%Y-%m-%d_%H-%M-%S")
|
135
135
|
rescue ArgumentError
|
136
|
-
error_message =
|
137
|
-
error_message <<
|
138
|
-
error_message <<
|
136
|
+
error_message = "BUILD_ID environment variable "
|
137
|
+
error_message << "should be in YYYY-MM-DD_hh-mm-ss "
|
138
|
+
error_message << "format."
|
139
139
|
raise ArgumentError, error_message
|
140
140
|
end
|
141
141
|
else
|
@@ -157,7 +157,7 @@ module Omnibus
|
|
157
157
|
# @return [String]
|
158
158
|
def git_describe
|
159
159
|
@git_describe ||= begin
|
160
|
-
cmd = shellout(
|
160
|
+
cmd = shellout("git describe --tags", cwd: @path)
|
161
161
|
|
162
162
|
if cmd.exitstatus == 0
|
163
163
|
cmd.stdout.chomp
|
@@ -166,7 +166,7 @@ module Omnibus
|
|
166
166
|
"Could not extract version information from 'git describe'! " \
|
167
167
|
"Setting version to 0.0.0."
|
168
168
|
end
|
169
|
-
|
169
|
+
"0.0.0"
|
170
170
|
end
|
171
171
|
end
|
172
172
|
end
|
@@ -187,7 +187,7 @@ module Omnibus
|
|
187
187
|
#
|
188
188
|
# @return [String]
|
189
189
|
def version_tag
|
190
|
-
version_composition.join(
|
190
|
+
version_composition.join(".")
|
191
191
|
end
|
192
192
|
|
193
193
|
# Return a prerelease tag string (if it exists), as extracted from {#git_describe}.
|
@@ -14,7 +14,7 @@
|
|
14
14
|
# limitations under the License.
|
15
15
|
#
|
16
16
|
|
17
|
-
require
|
17
|
+
require "time"
|
18
18
|
|
19
19
|
module Omnibus
|
20
20
|
class BuildVersionDSL
|
@@ -132,9 +132,9 @@ module Omnibus
|
|
132
132
|
# @param [String] version
|
133
133
|
# @return [Boolean]
|
134
134
|
def has_timestamp?(version)
|
135
|
-
_ver, build_info = version.split(
|
135
|
+
_ver, build_info = version.split("+")
|
136
136
|
return false if build_info.nil?
|
137
|
-
build_info.split(
|
137
|
+
build_info.split(".").any? do |part|
|
138
138
|
begin
|
139
139
|
Time.strptime(part, Omnibus::BuildVersion::TIMESTAMP_FORMAT)
|
140
140
|
true
|