diff options
-rw-r--r-- | habitat/plan.sh | 8 | ||||
-rw-r--r-- | kitchen-tests/kitchen.yml | 11 | ||||
-rw-r--r-- | omnibus/Gemfile.lock | 54 | ||||
-rw-r--r-- | post-bundle-install.rb | 27 |
4 files changed, 66 insertions, 34 deletions
diff --git a/habitat/plan.sh b/habitat/plan.sh index 2bc13785d8..1f7c4fb065 100644 --- a/habitat/plan.sh +++ b/habitat/plan.sh @@ -95,14 +95,10 @@ do_build() { ( cd "$CACHE_PATH" || exit_with "unable to enter hab-cache directory" 1 build_line "Installing gem dependencies ..." bundle install --jobs=3 --retry=3 + build_line "Installing gems from git repos properly ..." + ruby ./post-bundle-install.rb build_line "Installing this project's gems ..." bundle exec rake install - for gem in $GEM_HOME/bundler/gems/*; do - ( cd $gem - build_line "Installing gems from git repos properly ..." - rake install - ) - done ) } diff --git a/kitchen-tests/kitchen.yml b/kitchen-tests/kitchen.yml index 3ceb111f6a..fccf46bb22 100644 --- a/kitchen-tests/kitchen.yml +++ b/kitchen-tests/kitchen.yml @@ -22,8 +22,18 @@ lifecycle: - remote: /opt/chef/embedded/bin/rake --version - remote: /opt/chef/embedded/bin/bundle -v - remote: /opt/chef/embedded/bin/gem install appbundler appbundle-updater --no-doc + - remote: scl enable devtoolset-8 '/opt/chef/embedded/bin/appbundle-updater chef ohai <%= File.readlines('../Gemfile.lock', File.expand_path(File.dirname(__FILE__))).find { |l| l =~ /^\s+ohai \((\d+\.\d+\.\d+)\)/ }; 'v' + $1 %> --tarball --github chef/ohai' + includes: + - centos-6 + - remote: scl enable devtoolset-8 '/opt/chef/embedded/bin/appbundle-updater chef chef <%= ENV['BUILDKITE_COMMIT'] || %x(git rev-parse HEAD).chomp %> --tarball --github chef/chef' + includes: + - centos-6 - remote: /opt/chef/embedded/bin/appbundle-updater chef ohai <%= File.readlines('../Gemfile.lock', File.expand_path(File.dirname(__FILE__))).find { |l| l =~ /^\s+ohai \((\d+\.\d+\.\d+)\)/ }; 'v' + $1 %> --tarball --github chef/ohai + excludes: + - centos-6 - remote: /opt/chef/embedded/bin/appbundle-updater chef chef <%= ENV['BUILDKITE_COMMIT'] || %x(git rev-parse HEAD).chomp %> --tarball --github chef/chef + excludes: + - centos-6 - remote: echo "Installed Chef / Ohai release:" - remote: /opt/chef/bin/chef-client -v - remote: /opt/chef/bin/ohai -v @@ -76,7 +86,6 @@ platforms: - RUN sed -i -e "s/Defaults.*requiretty.*/Defaults !requiretty/g" /etc/sudoers - RUN yum install -y centos-release-scl - RUN yum install -y devtoolset-7 - - RUN scl enable devtoolset-7 bash - name: centos-7 driver: diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index 822ed15ebb..827136634b 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -18,7 +18,7 @@ GIT GIT remote: https://github.com/chef/omnibus-software - revision: f903311ba8ae9ff8f1e7bd7a9c21421fd39f7c7e + revision: 5286aa675239cf2ed36c7412625fbfb375575fdd branch: master specs: omnibus-software (4.0.0) @@ -32,7 +32,7 @@ GEM artifactory (3.0.15) awesome_print (1.9.2) aws-eventstream (1.1.1) - aws-partitions (1.433.0) + aws-partitions (1.434.0) aws-sdk-core (3.113.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) @@ -41,15 +41,15 @@ GEM aws-sdk-kms (1.43.0) aws-sdk-core (~> 3, >= 3.112.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.91.0) + aws-sdk-s3 (1.92.0) aws-sdk-core (~> 3, >= 3.112.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) aws-sigv4 (1.2.3) aws-eventstream (~> 1, >= 1.0.2) - bcrypt_pbkdf (1.1.0.rc2) - bcrypt_pbkdf (1.1.0.rc2-x64-mingw32) - bcrypt_pbkdf (1.1.0.rc2-x86-mingw32) + bcrypt_pbkdf (1.1.0) + bcrypt_pbkdf (1.1.0-x64-mingw32) + bcrypt_pbkdf (1.1.0-x86-mingw32) berkshelf (7.2.0) chef (>= 15.7.32) chef-config @@ -64,12 +64,12 @@ GEM solve (~> 4.0) thor (>= 0.20) builder (3.2.4) - chef (16.10.8) + chef (16.11.7) addressable - bcrypt_pbkdf (= 1.1.0.rc2) + bcrypt_pbkdf (~> 1.1) bundler (>= 1.10) - chef-config (= 16.10.8) - chef-utils (= 16.10.8) + chef-config (= 16.11.7) + chef-utils (= 16.11.7) chef-vault chef-zero (>= 14.0.11) diff-lcs (>= 1.2.4, < 1.4.0) @@ -101,12 +101,12 @@ GEM tty-screen (~> 0.6) tty-table (~> 0.11) uuidtools (>= 2.1.5, < 3.0) - chef (16.10.8-universal-mingw32) + chef (16.11.7-universal-mingw32) addressable - bcrypt_pbkdf (= 1.1.0.rc2) + bcrypt_pbkdf (~> 1.1) bundler (>= 1.10) - chef-config (= 16.10.8) - chef-utils (= 16.10.8) + chef-config (= 16.11.7) + chef-utils (= 16.11.7) chef-vault chef-zero (>= 14.0.11) diff-lcs (>= 1.2.4, < 1.4.0) @@ -140,7 +140,7 @@ GEM tty-table (~> 0.11) uuidtools (>= 2.1.5, < 3.0) win32-api (~> 1.5.3) - win32-certstore (~> 0.5) + win32-certstore (~> 0.5.0) win32-event (~> 0.6.1) win32-eventlog (= 0.6.3) win32-mmap (~> 0.4.1) @@ -150,18 +150,17 @@ GEM win32-taskscheduler (~> 2.0) wmi-lite (~> 1.0) chef-cleanroom (1.0.2) - chef-config (16.10.8) + chef-config (16.11.7) addressable - chef-utils (= 16.10.8) + chef-utils (= 16.11.7) fuzzyurl mixlib-config (>= 2.2.12, < 4.0) mixlib-shellout (>= 2.0, < 4.0) tomlrb (~> 1.2) - chef-telemetry (1.0.14) + chef-telemetry (1.0.29) chef-config concurrent-ruby (~> 1.0) - ffi-yajl (~> 2.2) - chef-utils (16.10.8) + chef-utils (16.11.7) chef-vault (4.1.0) chef-zero (15.0.4) ffi-yajl (~> 2.2) @@ -203,7 +202,7 @@ GEM highline (2.0.3) httpclient (2.8.3) iniparse (1.5.0) - inspec-core (4.26.4) + inspec-core (4.28.0) addressable (~> 2.4) chef-telemetry (~> 1.0) faraday (>= 0.9.0, < 1.4) @@ -253,11 +252,11 @@ GEM mixlib-log mixlib-archive (1.1.7-universal-mingw32) mixlib-log - mixlib-authentication (3.0.7) + mixlib-authentication (3.0.10) mixlib-cli (2.1.8) mixlib-config (3.0.9) tomlrb - mixlib-install (3.12.7) + mixlib-install (3.12.11) mixlib-shellout mixlib-versioning thor @@ -347,15 +346,16 @@ GEM molinillo (~> 0.6) semverse (>= 1.1, < 4.0) sslshake (1.3.1) - strings (0.2.0) + strings (0.2.1) strings-ansi (~> 0.2) - unicode-display_width (~> 1.5) + unicode-display_width (>= 1.5, < 3.0) unicode_utils (~> 1.4) strings-ansi (0.2.0) structured_warnings (0.4.0) syslog-logger (1.6.8) - test-kitchen (2.10.0) + test-kitchen (2.11.1) bcrypt_pbkdf (~> 1.0) + chef-utils (>= 16.4.35) ed25519 (~> 1.2) license-acceptance (>= 1.0.11, < 3.0) mixlib-install (~> 3.6) @@ -400,7 +400,7 @@ GEM pastel (~> 0.8) strings (~> 0.2.0) tty-screen (~> 0.8) - unicode-display_width (1.7.0) + unicode-display_width (2.0.0) unicode_utils (1.4.0) uuidtools (2.2.0) webrick (1.7.0) diff --git a/post-bundle-install.rb b/post-bundle-install.rb new file mode 100644 index 0000000000..f0db5d50b0 --- /dev/null +++ b/post-bundle-install.rb @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby + +gem_home = Gem.paths.home + +puts "fixing bundle installed gems in #{gem_home}" + +# Install gems from git repos. This makes the assumption that there is a <gem_name>.gemspec and +# you can simply gem build + gem install the resulting gem, so nothing fancy. This does not use +# rake install since we need --conservative --minimal-deps in order to not install duplicate gems. +# +Dir["#{gem_home}/bundler/gems/*"].each do |gempath| + matches = File.basename(gempath).match(/(.*)-[A-Fa-f0-9]{12}/) + next unless matches + + gem_name = matches[1] + next unless gem_name + + puts "re-installing #{gem_name}..." + + # we can't use "commmand" or "bundle" or "gem" DSL methods here since those are lazy and we need to run commands immediately + # (this is like a shell_out inside of a ruby_block in core chef, you don't use an execute resource inside of a ruby_block or + # things get really weird and unexpected) + Dir.chdir(gempath) do + system("gem build #{gem_name}.gemspec") or raise "gem build failed" + system("gem install #{gem_name}*.gem --conservative --minimal-deps --no-document") or raise "gem install failed" + end +end |