omnibus 6.1.7 → 8.0.9
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 +4 -4
- data/Gemfile +0 -4
- data/README.md +54 -12
- data/Rakefile +1 -1
- data/bin/omnibus +1 -1
- data/lib/omnibus.rb +2 -2
- data/lib/omnibus/build_version.rb +1 -1
- data/lib/omnibus/build_version_dsl.rb +6 -7
- data/lib/omnibus/builder.rb +10 -9
- data/lib/omnibus/changelog_printer.rb +7 -4
- data/lib/omnibus/cleaner.rb +4 -1
- data/lib/omnibus/cli.rb +2 -2
- data/lib/omnibus/cli/changelog.rb +25 -25
- data/lib/omnibus/compressor.rb +2 -2
- data/lib/omnibus/compressors/base.rb +2 -2
- data/lib/omnibus/compressors/dmg.rb +8 -6
- data/lib/omnibus/compressors/tgz.rb +2 -2
- data/lib/omnibus/config.rb +13 -3
- data/lib/omnibus/core_extensions/open_uri.rb +1 -1
- data/lib/omnibus/digestable.rb +2 -2
- data/lib/omnibus/download_helpers.rb +6 -2
- data/lib/omnibus/fetchers/file_fetcher.rb +1 -1
- data/lib/omnibus/fetchers/git_fetcher.rb +1 -0
- data/lib/omnibus/fetchers/net_fetcher.rb +3 -4
- data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
- data/lib/omnibus/file_syncer.rb +1 -1
- data/lib/omnibus/generator.rb +2 -2
- data/lib/omnibus/generator_files/README.md.erb +20 -16
- data/lib/omnibus/generator_files/config/software/preparation.rb.erb +1 -1
- data/lib/omnibus/generator_files/omnibus.rb.erb +5 -4
- data/lib/omnibus/git_cache.rb +2 -2
- data/lib/omnibus/health_check.rb +3 -1
- data/lib/omnibus/licensing.rb +5 -6
- data/lib/omnibus/logger.rb +3 -2
- data/lib/omnibus/manifest.rb +2 -2
- data/lib/omnibus/metadata.rb +2 -2
- data/lib/omnibus/ohai.rb +1 -1
- data/lib/omnibus/package.rb +1 -1
- data/lib/omnibus/packager.rb +6 -14
- data/lib/omnibus/packagers/appx.rb +1 -2
- data/lib/omnibus/packagers/base.rb +2 -1
- data/lib/omnibus/packagers/bff.rb +6 -8
- data/lib/omnibus/packagers/deb.rb +7 -10
- data/lib/omnibus/packagers/ips.rb +3 -6
- data/lib/omnibus/packagers/makeself.rb +1 -2
- data/lib/omnibus/packagers/msi.rb +13 -12
- data/lib/omnibus/packagers/pkg.rb +125 -9
- data/lib/omnibus/packagers/rpm.rb +11 -12
- data/lib/omnibus/packagers/solaris.rb +5 -5
- data/lib/omnibus/packagers/windows_base.rb +7 -6
- data/lib/omnibus/project.rb +3 -2
- data/lib/omnibus/publisher.rb +2 -2
- data/lib/omnibus/publishers/artifactory_publisher.rb +2 -2
- data/lib/omnibus/publishers/s3_publisher.rb +6 -4
- data/lib/omnibus/s3_cache.rb +4 -2
- data/lib/omnibus/s3_helpers.rb +7 -7
- data/lib/omnibus/software.rb +68 -43
- data/lib/omnibus/sugarable.rb +5 -14
- data/lib/omnibus/templating.rb +2 -2
- data/lib/omnibus/thread_pool.rb +0 -2
- data/lib/omnibus/util.rb +4 -3
- data/lib/omnibus/version.rb +1 -1
- data/lib/omnibus/whitelist.rb +24 -1
- data/omnibus.gemspec +8 -9
- data/resources/ips/doc-transform.erb +1 -0
- data/resources/msi/CustomActionFastMsi.CA.dll +0 -0
- data/resources/msi/source.wxs.erb +2 -10
- data/resources/rpm/signing.erb +7 -10
- data/spec/functional/builder_spec.rb +2 -1
- data/spec/functional/fetchers/file_fetcher_spec.rb +4 -4
- data/spec/functional/fetchers/git_fetcher_spec.rb +4 -4
- data/spec/functional/fetchers/net_fetcher_spec.rb +5 -6
- data/spec/functional/fetchers/path_fetcher_spec.rb +4 -4
- data/spec/functional/licensing_spec.rb +5 -5
- data/spec/support/examples.rb +3 -4
- data/spec/support/path_helpers.rb +2 -2
- data/spec/unit/builder_spec.rb +9 -9
- data/spec/unit/changelogprinter_spec.rb +8 -6
- data/spec/unit/compressor_spec.rb +4 -4
- data/spec/unit/compressors/dmg_spec.rb +5 -2
- data/spec/unit/fetchers/net_fetcher_spec.rb +16 -17
- data/spec/unit/health_check_spec.rb +2 -6
- data/spec/unit/library_spec.rb +2 -1
- data/spec/unit/manifest_diff_spec.rb +2 -2
- data/spec/unit/manifest_spec.rb +1 -1
- data/spec/unit/metadata_spec.rb +14 -17
- data/spec/unit/omnibus_spec.rb +1 -1
- data/spec/unit/packager_spec.rb +6 -13
- data/spec/unit/packagers/bff_spec.rb +2 -2
- data/spec/unit/packagers/ips_spec.rb +1 -0
- data/spec/unit/packagers/msi_spec.rb +2 -2
- data/spec/unit/packagers/pkg_spec.rb +354 -0
- data/spec/unit/packagers/pkgsrc_spec.rb +1 -1
- data/spec/unit/packagers/rpm_spec.rb +5 -5
- data/spec/unit/packagers/solaris_spec.rb +7 -7
- data/spec/unit/project_spec.rb +7 -7
- data/spec/unit/publisher_spec.rb +1 -2
- data/spec/unit/publishers/artifactory_publisher_spec.rb +2 -4
- data/spec/unit/publishers/s3_publisher_spec.rb +2 -4
- data/spec/unit/s3_cacher_spec.rb +19 -6
- data/spec/unit/s3_helpers_spec.rb +22 -3
- data/spec/unit/software_spec.rb +59 -120
- data/spec/unit/util_spec.rb +1 -2
- metadata +21 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2d82119c178b28f06df2bcd81c54b97ffbbe8b16b072021e3c86297e7ba76b9c
|
|
4
|
+
data.tar.gz: 0fd1477fe37432ec09256c115243b1a06eaa62911b741ba8a2dec730b9b8e42b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 534731ae9d91c9b9108cb63e6bacf731817ae8e01a80d22615e93787e50ba148c4e7919934879c2b7bdf1bda51586cbe488648dc3c6c31b9d3684f489602fd02
|
|
7
|
+
data.tar.gz: 37bbc008548ed0ab0a1d20f958a81a19de17c47da4176ca263587cf11bfb6bffc31c50691d76ea9304e2c22223becfa1afa79de6682e32f8fe9f07d63e8ddd6e
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -25,8 +25,7 @@ This project is managed by the CHEF Release Engineering team. For more informati
|
|
|
25
25
|
|
|
26
26
|
Omnibus is designed to run with a minimal set of prerequisites. You will need the following:
|
|
27
27
|
|
|
28
|
-
- Ruby 2.
|
|
29
|
-
- Bundler
|
|
28
|
+
- Ruby 2.6+
|
|
30
29
|
|
|
31
30
|
## Get Started
|
|
32
31
|
|
|
@@ -46,10 +45,11 @@ $ omnibus new $MY_PROJECT_NAME
|
|
|
46
45
|
|
|
47
46
|
This will generate a complete project skeleton in the directory `omnibus-$MY_PROJECT_NAME`
|
|
48
47
|
|
|
48
|
+
By default this will make a directory called `omnibus-$MY_PROJECT_NAME` assuming you're keeping your omnibus config separate from the repo. However, keeping it *in* your repo is a common practice, so feel to rename this directory to `omnibus` and place it in the top level of your projects source repo.
|
|
49
|
+
|
|
49
50
|
```bash
|
|
50
51
|
$ cd omnibus-$MY_PROJECT_NAME
|
|
51
52
|
$ bundle install --binstubs
|
|
52
|
-
$ bin/omnibus build $MY_PROJECT_NAME
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
More details can be found in the generated project's README file.
|
|
@@ -84,11 +84,19 @@ use_git_caching false
|
|
|
84
84
|
# Enable S3 asset caching
|
|
85
85
|
# ------------------------------
|
|
86
86
|
use_s3_caching true
|
|
87
|
+
s3_bucket ENV['S3_BUCKET']
|
|
88
|
+
|
|
89
|
+
# There are three ways to authenticate to the S3 bucket
|
|
90
|
+
|
|
91
|
+
# 1. set `s3_access_key` and `s3_secret_key`
|
|
87
92
|
s3_access_key ENV['S3_ACCESS_KEY']
|
|
88
93
|
s3_secret_key ENV['S3_SECRET_KEY']
|
|
89
|
-
|
|
94
|
+
|
|
95
|
+
# 2. set `s3_profile` to use an AWS profile in the Shared Credentials files
|
|
90
96
|
#s3_profile ENV['S3_PROFILE']
|
|
91
|
-
|
|
97
|
+
|
|
98
|
+
# 3. set `s3_iam_role_arn` to use an AWS IAM role
|
|
99
|
+
#s3_iam_role_arn ENV['S3_IAM_ROLE_ARN']
|
|
92
100
|
```
|
|
93
101
|
|
|
94
102
|
For more information, please see the [`Config` documentation](http://www.rubydoc.info/github/chef/omnibus/Omnibus/Config).
|
|
@@ -135,7 +143,7 @@ DSL Method | Description
|
|
|
135
143
|
`package` | Invoke a packager-specific DSL
|
|
136
144
|
`compress` | Invoke a compressor-specific DSL
|
|
137
145
|
|
|
138
|
-
By default a timestamp is appended to the build_version. You can turn this behavior off by setting `append_timestamp` to `false` in your
|
|
146
|
+
By default a timestamp is appended to the build_version. You can turn this behavior off by setting `append_timestamp` to `false` in your `omnibus.rb` or using `--override append_timestamp:false` at the command line.
|
|
139
147
|
|
|
140
148
|
For more information, please see the [`Project` documentation](http://www.rubydoc.info/github/chef/omnibus/Omnibus/Project).
|
|
141
149
|
|
|
@@ -253,12 +261,46 @@ For all of these paths, **order matters**, so it is possible to depend on local
|
|
|
253
261
|
$PWD/config/software/foo.rb
|
|
254
262
|
/path/to/software/config/software/foo.rb
|
|
255
263
|
/other/path/to/software/config/software/foo.rb
|
|
256
|
-
/Users/sethvargo/.gems/.../my-
|
|
264
|
+
/Users/sethvargo/.gems/.../my-company-omnibus-software/config/software/foo.rb
|
|
257
265
|
/Users/sethvargo/.gems/.../omnibus-software/config/software/foo.rb
|
|
258
266
|
```
|
|
259
267
|
|
|
260
268
|
The first instance of `foo.rb` that is encountered will be used. Please note that **local** (vendored) softare definitions take precedence!
|
|
261
269
|
|
|
270
|
+
## Building
|
|
271
|
+
|
|
272
|
+
Once you've created your package and software definitions you can build with:
|
|
273
|
+
|
|
274
|
+
```shell
|
|
275
|
+
./bin/omnibus build $MY_PACKAGE_NAME
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
However there are several caveats to be aware of:
|
|
279
|
+
|
|
280
|
+
1. You will almost certainly want to uncomment the `base_dir` in `omnibus.rb`,
|
|
281
|
+
or at the very least change `cache_dir` and `build_dir` as otherwise it'll try
|
|
282
|
+
to use `/var/cache/omnibus` and `/opt/$MY_PROJECT_NAME`, requiring root.
|
|
283
|
+
1. The default configuration created for you references a lot of things
|
|
284
|
+
that are in the default config that come from the `omnibus-software` gem.
|
|
285
|
+
So you want to use those you'll need to either uncomment it in the `Gemfile`,
|
|
286
|
+
or fork it, and then reference your own
|
|
287
|
+
1. If this is a ruby project and you want binstubs in `/opt/$project/bin`, you
|
|
288
|
+
will either need to use [appbundler](https://github.com/chef/appbundler), or
|
|
289
|
+
you will need to have a post install step to create those binstubs.
|
|
290
|
+
- Side note, appbundler requires that you include your Gemfile and gemspec
|
|
291
|
+
in your gem.
|
|
292
|
+
- Also, needs to be in your Gemfile for you to use it, as it also must
|
|
293
|
+
be in the resulting gem.
|
|
294
|
+
1. If you specify an override of the version of the `ruby`, you will also need
|
|
295
|
+
to override `rubygems` and `bundler` to match the versions in that version of
|
|
296
|
+
`ruby` or you'll get failures around bundler version mismatches.
|
|
297
|
+
|
|
298
|
+
The build command above will of course build on your local host thus being
|
|
299
|
+
specific to the OS and base system you are on. But the skeleten setup by
|
|
300
|
+
`omnibus new` already setup kitchen for you so that it's easy to build for
|
|
301
|
+
a variety of OSes, See the `README.md` in your generated omnibus directory
|
|
302
|
+
for details.
|
|
303
|
+
|
|
262
304
|
## Version Manifest
|
|
263
305
|
|
|
264
306
|
Git-based software definitions may specify branches as their default_version. In this case, the exact git revision to use will be determined at build-time unless a project override (see below) or external version manifest is used. To generate a version manifest use the `omnibus manifest` command:
|
|
@@ -273,7 +315,7 @@ This will output a JSON-formatted manifest containing the resolved version of ev
|
|
|
273
315
|
|
|
274
316
|
Sometimes a platform has libraries that need to be whitelisted so the healthcheck can pass. The whitelist found in the [healthcheck](https://github.com/chef/omnibus/blob/master/lib/omnibus/health_check.rb) code comprises the minimal required for successful builds on supported platforms.
|
|
275
317
|
|
|
276
|
-
To add your own whitelisted library, simply add
|
|
318
|
+
To add your own whitelisted library, simply add a regex to your software definition in your omnibus project as follows:
|
|
277
319
|
|
|
278
320
|
```
|
|
279
321
|
whitelist_file /libpcrecpp\.so\..+/
|
|
@@ -289,11 +331,11 @@ STATUS: _EXPERIMENTAL_
|
|
|
289
331
|
|
|
290
332
|
`omnibus changelog generate` will generate a changelog for an omnibus project. This command currently assumes:
|
|
291
333
|
|
|
292
|
-
- version-manifest.json is checked into the project root
|
|
293
|
-
-
|
|
294
|
-
-
|
|
334
|
+
- A version-manifest.json file is checked into the project root
|
|
335
|
+
- The project is a git repository
|
|
336
|
+
- Each version is tagged with a SemVer compliant annotated tag
|
|
295
337
|
- Any git-based sources are checked out at ../COMPONENT_NAME
|
|
296
|
-
- Any commit message line prepended with ChangeLog-Entry: should be added to the changelog
|
|
338
|
+
- Any commit message line prepended with ChangeLog-Entry: should be added to the changelog
|
|
297
339
|
|
|
298
340
|
These assumptions _will_ change as we determine what works best for a number of our projects.
|
|
299
341
|
|
data/Rakefile
CHANGED
data/bin/omnibus
CHANGED
data/lib/omnibus.rb
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
require "omnibus/core_extensions"
|
|
18
18
|
|
|
19
19
|
require "cleanroom"
|
|
20
|
-
require "pathname"
|
|
20
|
+
require "pathname" unless defined?(Pathname)
|
|
21
21
|
|
|
22
22
|
require "omnibus/digestable"
|
|
23
23
|
require "omnibus/exceptions"
|
|
@@ -208,7 +208,7 @@ module Omnibus
|
|
|
208
208
|
# @return [Pathname]
|
|
209
209
|
#
|
|
210
210
|
def source_root
|
|
211
|
-
@source_root ||= Pathname.new(File.expand_path("
|
|
211
|
+
@source_root ||= Pathname.new(File.expand_path("..", __dir__))
|
|
212
212
|
end
|
|
213
213
|
|
|
214
214
|
#
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
#
|
|
16
16
|
|
|
17
|
-
require "time"
|
|
17
|
+
require "time" unless defined?(Time.zone_offset)
|
|
18
18
|
|
|
19
19
|
module Omnibus
|
|
20
20
|
class BuildVersionDSL
|
|
@@ -134,13 +134,12 @@ module Omnibus
|
|
|
134
134
|
def has_timestamp?(version)
|
|
135
135
|
_ver, build_info = version.split("+")
|
|
136
136
|
return false if build_info.nil?
|
|
137
|
+
|
|
137
138
|
build_info.split(".").any? do |part|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
false
|
|
143
|
-
end
|
|
139
|
+
Time.strptime(part, Omnibus::BuildVersion::TIMESTAMP_FORMAT)
|
|
140
|
+
true
|
|
141
|
+
rescue ArgumentError
|
|
142
|
+
false
|
|
144
143
|
end
|
|
145
144
|
end
|
|
146
145
|
|
data/lib/omnibus/builder.rb
CHANGED
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
#
|
|
16
16
|
|
|
17
|
-
require "fileutils"
|
|
18
|
-
require "mixlib/shellout"
|
|
19
|
-
require "ostruct"
|
|
20
|
-
require "pathname"
|
|
17
|
+
require "fileutils" unless defined?(FileUtils)
|
|
18
|
+
require "mixlib/shellout" unless defined?(Mixlib::ShellOut)
|
|
19
|
+
require "ostruct" unless defined?(OpenStruct)
|
|
20
|
+
require "pathname" unless defined?(Pathname)
|
|
21
21
|
require "omnibus/whitelist"
|
|
22
22
|
|
|
23
23
|
module Omnibus
|
|
@@ -235,7 +235,8 @@ module Omnibus
|
|
|
235
235
|
clean_patch_path = patch_path
|
|
236
236
|
if windows?
|
|
237
237
|
clean_patch_path = Pathname.new(patch_path).relative_path_from(
|
|
238
|
-
Pathname.new(software.project_dir)
|
|
238
|
+
Pathname.new(software.project_dir)
|
|
239
|
+
).to_s
|
|
239
240
|
end
|
|
240
241
|
|
|
241
242
|
if target
|
|
@@ -385,6 +386,7 @@ module Omnibus
|
|
|
385
386
|
if app_software.nil?
|
|
386
387
|
raise "could not find software definition for #{software_name}, add a dependency to it, or pass a lockdir argument to appbundle command."
|
|
387
388
|
end
|
|
389
|
+
|
|
388
390
|
app_software.project_dir
|
|
389
391
|
end
|
|
390
392
|
|
|
@@ -500,8 +502,7 @@ module Omnibus
|
|
|
500
502
|
render_template(source_path,
|
|
501
503
|
destination: dest,
|
|
502
504
|
mode: mode,
|
|
503
|
-
variables: vars
|
|
504
|
-
)
|
|
505
|
+
variables: vars)
|
|
505
506
|
end
|
|
506
507
|
end
|
|
507
508
|
expose :erb
|
|
@@ -596,7 +597,7 @@ module Omnibus
|
|
|
596
597
|
#
|
|
597
598
|
def strip(path)
|
|
598
599
|
regexp_ends = ".*(" + IGNORED_ENDINGS.map { |e| e.gsub(/\./, '\.') }.join("|") + ")$"
|
|
599
|
-
regexp_patterns = IGNORED_PATTERNS.map { |e| ".*" + e.gsub(
|
|
600
|
+
regexp_patterns = IGNORED_PATTERNS.map { |e| ".*" + e.gsub(%r{/}, '\/') + ".*" }.join("|")
|
|
600
601
|
regexp = regexp_ends + "|" + regexp_patterns
|
|
601
602
|
|
|
602
603
|
# Do not actually care if strip runs on non-strippable file, as its a no-op. Hence the `|| true` appended.
|
|
@@ -727,7 +728,7 @@ module Omnibus
|
|
|
727
728
|
# config.guess.to. Default: "."
|
|
728
729
|
# install [Array<Symbol>] parts of config.guess to copy.
|
|
729
730
|
# Default: [:config_guess, :config_sub]
|
|
730
|
-
def update_config_guess(target: ".", install:
|
|
731
|
+
def update_config_guess(target: ".", install: %i{config_guess config_sub})
|
|
731
732
|
build_commands << BuildCommand.new("update_config_guess `target: #{target} install: #{install.inspect}'") do
|
|
732
733
|
config_guess_dir = "#{install_dir}/embedded/lib/config_guess"
|
|
733
734
|
%w{config.guess config.sub}.each do |c|
|
|
@@ -8,9 +8,9 @@ module Omnibus
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def print(new_version)
|
|
11
|
-
puts "## #{new_version} (#{Time.now.strftime(
|
|
11
|
+
puts "## #{new_version} (#{Time.now.strftime("%Y-%m-%d")})"
|
|
12
12
|
print_changelog
|
|
13
|
-
|
|
13
|
+
unless diff.empty?
|
|
14
14
|
print_components
|
|
15
15
|
puts ""
|
|
16
16
|
end
|
|
@@ -23,7 +23,7 @@ module Omnibus
|
|
|
23
23
|
|
|
24
24
|
def print_changelog(cl = changelog, indent = 0)
|
|
25
25
|
cl.changelog_entries.each do |entry|
|
|
26
|
-
puts "#{
|
|
26
|
+
puts "#{" " * indent}* #{entry.sub("\n", "\n #{" " * indent}")}\n"
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -36,6 +36,7 @@ module Omnibus
|
|
|
36
36
|
|
|
37
37
|
def print_new_components
|
|
38
38
|
return if diff.added.empty?
|
|
39
|
+
|
|
39
40
|
puts "New Components"
|
|
40
41
|
diff.added.each do |entry|
|
|
41
42
|
puts "* #{entry[:name]} (#{entry[:new_version]})"
|
|
@@ -45,10 +46,11 @@ module Omnibus
|
|
|
45
46
|
|
|
46
47
|
def print_updated_components
|
|
47
48
|
return if diff.updated.empty?
|
|
49
|
+
|
|
48
50
|
puts "Updated Components"
|
|
49
51
|
diff.updated.each do |entry|
|
|
50
52
|
puts sprintf("* %s (%.8s -> %.8s)",
|
|
51
|
-
|
|
53
|
+
entry[:name], entry[:old_version], entry[:new_version])
|
|
52
54
|
repo_path = ::File.join(source_path, entry[:name].to_s)
|
|
53
55
|
if entry[:source_type] == :git && ::File.directory?("#{repo_path}/.git")
|
|
54
56
|
cl = ChangeLog.new(entry[:old_version], entry[:new_version], GitRepository.new("#{repo_path}"))
|
|
@@ -60,6 +62,7 @@ module Omnibus
|
|
|
60
62
|
|
|
61
63
|
def print_removed_components
|
|
62
64
|
return if diff.removed.empty?
|
|
65
|
+
|
|
63
66
|
puts "Removed Components"
|
|
64
67
|
diff.removed.each do |entry|
|
|
65
68
|
puts "* #{entry[:name]} (#{entry[:old_version]})"
|
data/lib/omnibus/cleaner.rb
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
#
|
|
16
16
|
|
|
17
|
-
require "thor"
|
|
17
|
+
require "thor" unless defined?(Thor)
|
|
18
18
|
|
|
19
19
|
module Omnibus
|
|
20
20
|
class Cleaner < Thor::Group
|
|
@@ -48,16 +48,19 @@ module Omnibus
|
|
|
48
48
|
|
|
49
49
|
def clean_package_dir
|
|
50
50
|
return unless purge?
|
|
51
|
+
|
|
51
52
|
FileSyncer.glob("#{Config.package_dir}/**/*").each(&method(:remove_file))
|
|
52
53
|
end
|
|
53
54
|
|
|
54
55
|
def clean_cache_dir
|
|
55
56
|
return unless purge?
|
|
57
|
+
|
|
56
58
|
FileSyncer.glob("#{Config.cache_dir}/**/*").each(&method(:remove_file))
|
|
57
59
|
end
|
|
58
60
|
|
|
59
61
|
def clean_install_dir
|
|
60
62
|
return unless purge?
|
|
63
|
+
|
|
61
64
|
remove_file(@project.install_dir)
|
|
62
65
|
end
|
|
63
66
|
|
data/lib/omnibus/cli.rb
CHANGED
|
@@ -18,7 +18,7 @@ require "omnibus/changelog"
|
|
|
18
18
|
require "omnibus/changelog_printer"
|
|
19
19
|
require "omnibus/manifest_diff"
|
|
20
20
|
require "omnibus/semantic_version"
|
|
21
|
-
require "ffi_yajl"
|
|
21
|
+
require "ffi_yajl" unless defined?(FFI_Yajl)
|
|
22
22
|
|
|
23
23
|
module Omnibus
|
|
24
24
|
class Command::ChangeLog < Command::Base
|
|
@@ -30,42 +30,42 @@ module Omnibus
|
|
|
30
30
|
# $ omnibus changelog generate
|
|
31
31
|
#
|
|
32
32
|
method_option :source_path,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
desc: "Path to local checkout of git dependencies",
|
|
34
|
+
type: :string,
|
|
35
|
+
default: "../"
|
|
36
36
|
|
|
37
37
|
method_option :starting_manifest,
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
desc: "Path to version-manifest from the last version (we attempt to pull it from the git history if not given)",
|
|
39
|
+
type: :string
|
|
40
40
|
|
|
41
41
|
method_option :ending_manifest,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
desc: "Path to the version-manifest from the current version",
|
|
43
|
+
type: :string,
|
|
44
|
+
default: "version-manifest.json"
|
|
45
45
|
|
|
46
46
|
method_option :skip_components,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
desc: "Don't include component changes in the changelog",
|
|
48
|
+
type: :boolean,
|
|
49
|
+
default: false
|
|
50
50
|
|
|
51
51
|
method_option :major,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
desc: "Bump the major version",
|
|
53
|
+
type: :boolean,
|
|
54
|
+
default: false
|
|
55
55
|
|
|
56
56
|
method_option :minor,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
desc: "Bump the minor version",
|
|
58
|
+
type: :boolean,
|
|
59
|
+
default: true
|
|
60
60
|
|
|
61
61
|
method_option :patch,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
desc: "Bump the patch version",
|
|
63
|
+
type: :boolean,
|
|
64
|
+
default: false
|
|
65
65
|
|
|
66
66
|
method_option :version,
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
desc: "Explicit version for this changelog",
|
|
68
|
+
type: :string
|
|
69
69
|
|
|
70
70
|
desc "generate [START] [END]", "Generate a changelog for a new release"
|
|
71
71
|
def generate(start_ref = nil, end_ref = nil)
|
|
@@ -78,8 +78,8 @@ module Omnibus
|
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
Omnibus::ChangeLogPrinter.new(ChangeLog.new(starting_revision, ending_revision),
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
diff,
|
|
82
|
+
@options[:source_path]).print(new_version)
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
private
|