Skip to content

Commit

Permalink
Merge branch 'master' into netfetcher_http_authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeXGreen authored Jan 7, 2019
2 parents 248d419 + 1cfcf17 commit a9d5e17
Show file tree
Hide file tree
Showing 17 changed files with 104 additions and 24 deletions.
54 changes: 52 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,62 @@
<!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->

<!-- latest_release 6.0.1 -->
<!-- latest_release 6.0.11 -->
## [v6.0.11](https://github.com/chef/omnibus/tree/v6.0.11) (2019-01-02)

#### Merged Pull Requests
- Change &#39;pretans&#39; to &#39;pretrans&#39; [#866](https://github.com/chef/omnibus/pull/866) ([ccheek21](https://github.com/ccheek21))
<!-- latest_release -->

## [v6.0.10](https://github.com/chef/omnibus/tree/v6.0.10) (2018-12-10)

#### Merged Pull Requests
- Revert &quot;Fix comparisons for semver style git tags&quot; [#865](https://github.com/chef/omnibus/pull/865) ([lamont-granquist](https://github.com/lamont-granquist))

## [v6.0.9](https://github.com/chef/omnibus/tree/v6.0.9) (2018-12-07)

#### Merged Pull Requests
- Fix comparisons for semver style git tags [#864](https://github.com/chef/omnibus/pull/864) ([lamont-granquist](https://github.com/lamont-granquist))

## [v6.0.8](https://github.com/chef/omnibus/tree/v6.0.8) (2018-12-03)

#### Merged Pull Requests
- S3 Publisher: Print the download URL for published artifacts [#829](https://github.com/chef/omnibus/pull/829) ([legal90](https://github.com/legal90))

## [v6.0.7](https://github.com/chef/omnibus/tree/v6.0.7) (2018-11-26)

#### Merged Pull Requests
- Use RPM on Amazon Linux 2 [#863](https://github.com/chef/omnibus/pull/863) ([repeatedly](https://github.com/repeatedly))

## [v6.0.6](https://github.com/chef/omnibus/tree/v6.0.6) (2018-11-19)

#### Merged Pull Requests
- Add &quot;cached_name&quot; option for net fetcher [#837](https://github.com/chef/omnibus/pull/837) ([legal90](https://github.com/legal90))

## [v6.0.5](https://github.com/chef/omnibus/tree/v6.0.5) (2018-11-19)

#### Merged Pull Requests
- Add support of LGPL-2.0 license [#825](https://github.com/chef/omnibus/pull/825) ([legal90](https://github.com/legal90))

## [v6.0.4](https://github.com/chef/omnibus/tree/v6.0.4) (2018-10-11)

#### Merged Pull Requests
- Remove generator file pins [#859](https://github.com/chef/omnibus/pull/859) ([lamont-granquist](https://github.com/lamont-granquist))

## [v6.0.3](https://github.com/chef/omnibus/tree/v6.0.3) (2018-10-11)

#### Merged Pull Requests
- Using aws-sdk-s3 [#855](https://github.com/chef/omnibus/pull/855) ([JackDanger](https://github.com/JackDanger))

## [v6.0.2](https://github.com/chef/omnibus/tree/v6.0.2) (2018-10-10)

#### Merged Pull Requests
- Unpin gcc-4.8 for later versions of Suse [#858](https://github.com/chef/omnibus/pull/858) ([jaymalasinha](https://github.com/jaymalasinha))

## [v6.0.1](https://github.com/chef/omnibus/tree/v6.0.1) (2018-08-10)

#### Merged Pull Requests
- Update Opscode references to Chef and bump copyrights [#850](https://github.com/chef/omnibus/pull/850) ([tas50](https://github.com/tas50))
- Bump to 6.0 and add release notes [#849](https://github.com/chef/omnibus/pull/849) ([tas50](https://github.com/tas50))
<!-- latest_release -->

## [v5.6.17](https://github.com/chef/omnibus/tree/v5.6.17) (2018-08-10)

Expand Down
1 change: 1 addition & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please refer to the Chef Community Code of Conduct at https://www.chef.io/code-of-conduct/
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.1
6.0.11
4 changes: 3 additions & 1 deletion lib/omnibus/compressors/dmg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ def prettify_dmg
end

#
# Compress the dmg using hdiutil and zlib.
# Compress the dmg using hdiutil and zlib. zlib offers better compression
# levels than bzip2 (10.4+) or LZFSE (10.11+), but takes longer to compress.
# We're willing to trade slightly longer build times for smaller package sizes.
#
# @return [void]
#
Expand Down
8 changes: 5 additions & 3 deletions lib/omnibus/fetchers/net_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,15 @@ def self.resolve_version(version, source)
end

#
# The path on disk to the downloaded asset. This method requires the
# presence of a +source_uri+.
# The path on disk to the downloaded asset. The filename is defined by
# +source :cached_name+. If ommited, then it comes from the software's
# +source :url+ value
#
# @return [String]
#
def downloaded_file
filename = File.basename(source[:url], "?*")
filename = source[:cached_name] if source[:cached_name]
filename ||= File.basename(source[:url], "?*")
File.join(Config.cache_dir, filename)
end

Expand Down
6 changes: 3 additions & 3 deletions lib/omnibus/generator_files/Gemfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ gem 'omnibus', '~> <%= Omnibus::VERSION.split('.')[0...-1].join('.') %>'
# by running `bundle install --without development` to speed up build times.
group :development do
# Use Berkshelf for resolving cookbook dependencies
gem 'berkshelf', '~> 3.3'
gem 'berkshelf'

# Use Test Kitchen with Vagrant for converging the build environment
gem 'test-kitchen', '~> 1.4'
gem 'kitchen-vagrant', '~> 0.18'
gem 'test-kitchen',
gem 'kitchen-vagrant',
end
1 change: 1 addition & 0 deletions lib/omnibus/licensing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ def collect_licenses_for(software)
"AGPL-3.0", # GNU Affero General Public License v3
"GPL-2.0", # GNU General Public License version 2.0
"GPL-3.0", # GNU General Public License version 3.0
"LGPL-2.0", # GNU Library or "Lesser" General Public License version 2.0
"LGPL-2.1", # GNU Library or "Lesser" General Public License version 2.1
"LGPL-3.0", # GNU Library or "Lesser" General Public License version 3.0
"HPND", # Historical Permission Notice and Disclaimer
Expand Down
1 change: 1 addition & 0 deletions lib/omnibus/packager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module Packager
"suse" => RPM,
"rhel" => RPM,
"wrlinux" => RPM,
"amazon" => RPM,
"aix" => BFF,
"solaris" => Solaris,
"ips" => IPS,
Expand Down
2 changes: 1 addition & 1 deletion lib/omnibus/packagers/rpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Packager::RPM < Packager::Base
preun: "preun",
postun: "postun",
verifyscript: "verifyscript",
pretans: "pretans",
pretrans: "pretrans",
posttrans: "posttrans",
}.freeze

Expand Down
22 changes: 18 additions & 4 deletions lib/omnibus/publishers/s3_publisher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,27 @@ def publish(&block)

# Upload the metadata first
log.debug(log_key) { "Uploading '#{package.metadata.name}'" }
store_object(key_for(package, package.metadata.name), FFI_Yajl::Encoder.encode(package.metadata.to_hash, pretty: true),
nil, access_policy)

s3_metadata_object = store_object(
key_for(package, package.metadata.name),
FFI_Yajl::Encoder.encode(package.metadata.to_hash, pretty: true),
nil,
access_policy
)

log.debug(log_key) { "Uploading is completed. Download URL (#{access_policy}): #{s3_metadata_object.public_url}" }

# Upload the actual package
log.info(log_key) { "Uploading '#{package.name}'" }
store_object(key_for(package, package.name), package.content,
package.metadata[:md5], access_policy)

s3_object = store_object(
key_for(package, package.name),
package.content,
package.metadata[:md5],
access_policy
)

log.info(log_key) { "Uploading is completed. Download URL (#{access_policy}): #{s3_object.public_url}" }

# If a block was given, "yield" the package to the caller
yield(package) if block
Expand Down
8 changes: 5 additions & 3 deletions lib/omnibus/s3_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

require "aws-sdk"
require "aws-sdk-s3"
require "aws-sdk-core/credentials"
require "aws-sdk-core/shared_credentials"
require "base64"
Expand Down Expand Up @@ -93,6 +93,9 @@ def get_credentials
Aws::SharedCredentials.new(profile_name: s3_configuration[:profile])
elsif s3_configuration[:access_key_id] && s3_configuration[:secret_access_key]
Aws::Credentials.new(s3_configuration[:access_key_id], s3_configuration[:secret_access_key])
else
# No credentials specified, only public data will be retrievable
Aws::Credentials.new(nil, nil)
end
end

Expand Down Expand Up @@ -126,7 +129,7 @@ def bucket
# @param [String] content_md5
# @param [String] acl
#
# @return [true]
# @return [Aws::S3::Object]
#
def store_object(key, content, content_md5, acl)
bucket.put_object({
Expand All @@ -135,7 +138,6 @@ def store_object(key, content, content_md5, acl)
content_md5: to_base64_digest(content_md5),
acl: acl,
})
true
end

#
Expand Down
4 changes: 2 additions & 2 deletions lib/omnibus/software.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def source(val = NULL)
extra_keys = val.keys - [
:git, :file, :path, :url, # fetcher types
:md5, :sha1, :sha256, :sha512, # hash type - common to all fetchers
:cookie, :warning, :unsafe, :extract, :authorization, # used by net_fetcher
:cookie, :warning, :unsafe, :extract, :authorization, :cached_name, # used by net_fetcher
:options, # used by path_fetcher
:submodules # used by git_fetcher
]
Expand Down Expand Up @@ -702,7 +702,7 @@ def with_standard_compiler_flags(env = {}, opts = {})
"CFLAGS" => "-I#{install_dir}/embedded/include -O2",
}
# Enable gcc version 4.8 if it is available
if which("gcc-4.8")
if which("gcc-4.8") && platform_version.satisfies?("< 12")
suse_flags["CC"] = "gcc-4.8"
suse_flags["CXX"] = "g++-4.8"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/omnibus/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
#

module Omnibus
VERSION = "6.0.1"
VERSION = "6.0.11"
end
2 changes: 1 addition & 1 deletion omnibus.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
gem.test_files = gem.files.grep(/^(test|spec|features)\//)
gem.require_paths = ["lib"]

gem.add_dependency "aws-sdk", "~> 2"
gem.add_dependency "aws-sdk-s3", "~> 1"
gem.add_dependency "chef-sugar", ">= 3.3"
gem.add_dependency "cleanroom", "~> 1.0"
gem.add_dependency "ffi-yajl", "~> 2.2"
Expand Down
7 changes: 7 additions & 0 deletions spec/unit/packager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ module Omnibus
end
end

context "on Amazon Linux 2" do
before { stub_ohai(platform: "amazon", version: "2") }
it "prefers RPM" do
expect(described_class.for_current_system).to eq([Packager::RPM])
end
end

context "on Debian" do
before { stub_ohai(platform: "debian", version: "8.11") }
it "prefers RPM" do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/packagers/rpm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ module Omnibus
end

context "when scripts are given" do
let(:scripts) { %w{ pre post preun postun verifyscript pretans posttrans } }
let(:scripts) { %w{ pre post preun postun verifyscript pretrans posttrans } }

before do
scripts.each do |script_name|
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/software_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ module Omnibus
before do
# sles identifies as suse
stub_ohai(platform: "suse", version: "12.2")
allow(subject).to receive(:which).with("gcc-4.8").and_return(false)
allow(subject).to receive(:which).with("gcc-4.8").and_return(true)
end

it "sets the defaults" do
Expand Down

0 comments on commit a9d5e17

Please sign in to comment.