diff options
-rw-r--r-- | .bldr.toml | 20 | ||||
-rw-r--r-- | .expeditor/config.yml | 5 | ||||
-rw-r--r-- | CHANGELOG.md | 11 | ||||
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | Gemfile.lock | 23 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | appveyor.yml | 3 | ||||
-rw-r--r-- | chef-bin/lib/chef-bin/version.rb | 2 | ||||
-rw-r--r-- | chef-config/lib/chef-config/version.rb | 2 | ||||
-rwxr-xr-x | ci/verify-chef.bat | 88 | ||||
-rwxr-xr-x | ci/verify-chef.sh | 114 | ||||
-rw-r--r-- | habitat-packages/scaffolding-chef/README.md | 15 | ||||
-rw-r--r-- | habitat-packages/scaffolding-chef/lib/scaffolding.ps1 | 132 | ||||
-rw-r--r-- | habitat-packages/scaffolding-chef/lib/scaffolding.sh | 189 | ||||
-rw-r--r-- | habitat-packages/scaffolding-chef/plan.ps1 | 15 | ||||
-rw-r--r-- | habitat-packages/scaffolding-chef/plan.sh | 28 | ||||
-rw-r--r-- | lib/chef/version.rb | 2 | ||||
-rw-r--r-- | omnibus/Gemfile.lock | 26 | ||||
-rw-r--r-- | omnibus/omnibus-test.ps1 | 14 | ||||
-rw-r--r-- | omnibus/omnibus-test.sh | 19 | ||||
-rw-r--r-- | omnibus_overrides.rb | 2 | ||||
-rw-r--r-- | spec/functional/resource/insserv_spec.rb | 1 |
23 files changed, 78 insertions, 639 deletions
diff --git a/.bldr.toml b/.bldr.toml index f86b5e682d..b3d8c1a158 100644 --- a/.bldr.toml +++ b/.bldr.toml @@ -16,23 +16,3 @@ paths = [ "omnibus", # TODO: Evaluate if we really need this in the future "tasks", ] - -[scaffolding-chef] -plan_path = "habitat-packages/scaffolding-chef" -build_targets = [ - "x86_64-linux", - "x86_64-linux-kernel2" - # "x86_64-windows" --- TODO: Expeditor does not currently support Windows, but will in the coming weeks. Uncomment me soon! -] -paths = [ - "bin", - "chef-bin", - "chef-config", - "ci", - "distro", - "ext", - "habitat-packages", - "lib", - "omnibus", # TODO: Evaluate if we really need this in the future - "tasks", -] diff --git a/.expeditor/config.yml b/.expeditor/config.yml index ca52c379ab..d6e0eda26c 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -72,7 +72,7 @@ merge_actions: - "Expeditor: Skip Habitat" - "Expeditor: Skip All" only_if: built_in:bump_version - - built_in:trigger_omnibus_release_build: + - trigger_pipeline:omnibus/release: ignore_labels: - "Expeditor: Skip Omnibus" - "Expeditor: Skip All" @@ -145,3 +145,6 @@ subscriptions: - workload: ruby_gem_published:license-acceptance-* actions: - bash:.expeditor/update_dep.sh + - workload: ruby_gem_published:ffi-libarchive-* + actions: + - bash:.expeditor/update_dep.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index aaf3b3cee1..1409ca04fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,20 @@ <!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ --> -<!-- latest_release 15.1.21 --> -## [v15.1.21](https://github.com/chef/chef/tree/v15.1.21) (2019-06-22) +<!-- latest_release 15.1.26 --> +## [v15.1.26](https://github.com/chef/chef/tree/v15.1.26) (2019-06-25) #### Merged Pull Requests -- Bump ohai to 15.1.5 [#8681](https://github.com/chef/chef/pull/8681) ([chef-ci](https://github.com/chef-ci)) +- Improve how we bundler install in appveyor [#8663](https://github.com/chef/chef/pull/8663) ([tas50](https://github.com/tas50)) <!-- latest_release --> <!-- release_rollup since=15.0.300 --> ### Changes not yet released to rubygems.org #### Merged Pull Requests +- Improve how we bundler install in appveyor [#8663](https://github.com/chef/chef/pull/8663) ([tas50](https://github.com/tas50)) <!-- 15.1.26 --> +- Pin to ruby-prof 0.17 [#8690](https://github.com/chef/chef/pull/8690) ([tas50](https://github.com/tas50)) <!-- 15.1.25 --> +- Update Rubygems to 3.0.4 [#8689](https://github.com/chef/chef/pull/8689) ([tas50](https://github.com/tas50)) <!-- 15.1.24 --> +- [scaffolding-chef] Rolling out the scaffolding-chef package [#8679](https://github.com/chef/chef/pull/8679) ([echohack](https://github.com/echohack)) <!-- 15.1.23 --> +- Update ffi-libarchive to 0.4.10 [#8688](https://github.com/chef/chef/pull/8688) ([tas50](https://github.com/tas50)) <!-- 15.1.22 --> - Bump ohai to 15.1.5 [#8681](https://github.com/chef/chef/pull/8681) ([chef-ci](https://github.com/chef-ci)) <!-- 15.1.21 --> - [chef-client] [scaffolding-chef] add new build configuration for scaffolding-chef [#8678](https://github.com/chef/chef/pull/8678) ([echohack](https://github.com/echohack)) <!-- 15.1.20 --> - [chef-client] [scaffolding-chef] add new build configuration for scaffolding-chef [#8677](https://github.com/chef/chef/pull/8677) ([echohack](https://github.com/echohack)) <!-- 15.1.19 --> @@ -45,7 +45,7 @@ end # Everything except AIX group(:ruby_prof) do - gem "ruby-prof" + gem "ruby-prof", "< 0.18" # 0.18 includes a x64-mingw32 gem, which doesn't load correctly. See https://github.com/ruby-prof/ruby-prof/issues/255 end # Everything except AIX and Windows diff --git a/Gemfile.lock b/Gemfile.lock index 11903abae0..b6751b71ed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,7 +8,7 @@ GIT GIT remote: https://github.com/chef/ohai.git - revision: 065279661e0a99ade524de7549fa3e1eaf00b453 + revision: 7e0dc7e7dec232d3b4f74f7e9bde422f4334aaa8 branch: master specs: ohai (15.1.5) @@ -27,11 +27,11 @@ GIT PATH remote: . specs: - chef (15.1.21) + chef (15.1.26) addressable bcrypt_pbkdf (~> 1.0) bundler (>= 1.10) - chef-config (= 15.1.21) + chef-config (= 15.1.26) chef-zero (>= 14.0.11) diff-lcs (~> 1.2, >= 1.2.4) ed25519 (~> 1.2) @@ -57,11 +57,11 @@ PATH train-core (~> 2.0, >= 2.0.12) tty-screen (~> 0.6) uuidtools (~> 2.1.5) - chef (15.1.21-universal-mingw32) + chef (15.1.26-universal-mingw32) addressable bcrypt_pbkdf (~> 1.0) bundler (>= 1.10) - chef-config (= 15.1.21) + chef-config (= 15.1.26) chef-zero (>= 14.0.11) diff-lcs (~> 1.2, >= 1.2.4) ed25519 (~> 1.2) @@ -103,13 +103,13 @@ PATH PATH remote: chef-bin specs: - chef-bin (15.1.21) - chef (= 15.1.21) + chef-bin (15.1.26) + chef (= 15.1.26) PATH remote: chef-config specs: - chef-config (15.1.21) + chef-config (15.1.26) addressable fuzzyurl mixlib-config (>= 2.2.12, < 4.0) @@ -158,7 +158,7 @@ GEM ffi (1.11.1) ffi (1.11.1-x64-mingw32) ffi (1.11.1-x86-mingw32) - ffi-libarchive (0.4.6) + ffi-libarchive (0.4.10) ffi (~> 1.0) ffi-win32-extensions (1.0.3) ffi @@ -300,8 +300,7 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.4.0) - ruby-prof (0.18.0) - ruby-prof (0.18.0-x64-mingw32) + ruby-prof (0.17.0) ruby-progressbar (1.10.1) ruby-shadow (2.5.0) rubyntlm (0.6.2) @@ -436,7 +435,7 @@ DEPENDENCIES rspec-expectations (~> 3.5) rspec-mocks (~> 3.5) rspec_junit_formatter (~> 0.2.0) - ruby-prof + ruby-prof (< 0.18) ruby-shadow simplecov webmock @@ -1,6 +1,6 @@ # Chef Infra [![Code Climate](https://codeclimate.com/github/chef/chef.svg)](https://codeclimate.com/github/chef/chef) -[![Build Status](https://badge.buildkite.com/c82093430ceec7d27af05febb9dcafe3aa331fff9d74c0ab9d.svg)](https://buildkite.com/chef-oss/chef-chef-master-verify) +[![Build Status](https://badge.buildkite.com/c82093430ceec7d27af05febb9dcafe3aa331fff9d74c0ab9d.svg?branch=master)](https://buildkite.com/chef-oss/chef-chef-master-verify) [![Build Status Master](https://ci.appveyor.com/api/projects/status/github/chef/chef?branch=master&svg=true&passingText=master%20-%20Ok&pendingText=master%20-%20Pending&failingText=master%20-%20Failing)](https://ci.appveyor.com/project/Chef/chef/branch/master) [![Gem Version](https://badge.fury.io/rb/chef.svg)](https://badge.fury.io/rb/chef) [![](https://img.shields.io/badge/Release%20Policy-Cadence%20Release-brightgreen.svg)](https://github.com/chef/chef-rfc/blob/master/rfc086-chef-oss-project-policies.md#cadence-release) @@ -1 +1 @@ -15.1.21
\ No newline at end of file +15.1.26
\ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 649181b224..b7be639c1b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -41,9 +41,8 @@ install: - echo %PATH% - appveyor DownloadFile http://curl.haxx.se/ca/cacert.pem -FileName C:\cacert.pem - set SSL_CERT_FILE=C:\cacert.pem - - SET BUNDLE_WITHOUT=server:docgen:pry:integration:ci - bundle config --local path vendor/bundle # use the cache we define above - - bundle install || bundle install || bundle install + - bundle install --jobs=3 --retry=3 --without omnibus_package docgen chefstyle - SET SPEC_OPTS=--format progress - SET CHEF_LICENSE="accept-no-persist" diff --git a/chef-bin/lib/chef-bin/version.rb b/chef-bin/lib/chef-bin/version.rb index aa72b7be95..9a650287cb 100644 --- a/chef-bin/lib/chef-bin/version.rb +++ b/chef-bin/lib/chef-bin/version.rb @@ -21,7 +21,7 @@ module ChefBin CHEFBIN_ROOT = File.expand_path("../..", __FILE__) - VERSION = "15.1.21".freeze + VERSION = "15.1.26".freeze end # diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index ab073b947e..50f4922a31 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -21,7 +21,7 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("../..", __FILE__) - VERSION = "15.1.21".freeze + VERSION = "15.1.26".freeze end # diff --git a/ci/verify-chef.bat b/ci/verify-chef.bat deleted file mode 100755 index 37e5bcd323..0000000000 --- a/ci/verify-chef.bat +++ /dev/null @@ -1,88 +0,0 @@ - -@ECHO OFF - -REM ; %PROJECT_NAME% is set by Jenkins, this allows us to use the same script to verify -REM ; Chef and Angry Chef -cd C:\opscode\%PROJECT_NAME%\bin - -REM ; We don't want to add the embedded bin dir to the main PATH as this -REM ; could mask issues in our binstub shebangs. -SET EMBEDDED_BIN_DIR=C:\opscode\%PROJECT_NAME%\embedded\bin - -ECHO. - -REM ; Set the temporary directory to a custom location, and wipe it before -REM ; and after the tests run. -SET TEMP=%TEMP%\cheftest -SET TMP=%TMP%\cheftest -RMDIR /S /Q %TEMP% -MKDIR %TEMP% - -REM ; FIXME: we should really use Bundler.with_clean_env in the caller instead of re-inventing it here -set _ORIGINAL_GEM_PATH= -set BUNDLE_BIN_PATH= -set BUNDLE_GEMFILE= -set GEM_HOME= -set GEM_PATH= -set GEM_ROOT= -set RUBYLIB= -set RUBYOPT= -set RUBY_ENGINE= -set RUBY_ROOT= -set RUBY_VERSION= -set BUNDLER_VERSION= - -FOR %%b IN ( - chef-client - knife - chef-solo - ohai -) DO ( - - - ECHO Checking for existence of binfile `%%b`... - - IF EXIST %%b ( - ECHO ...FOUND IT! - ) ELSE ( - GOTO :error - ) - ECHO. -) - -call chef-client --version - -REM ; Exercise various packaged tools to validate binstub shebangs -call %EMBEDDED_BIN_DIR%\ruby --version -call %EMBEDDED_BIN_DIR%\gem --version -call %EMBEDDED_BIN_DIR%\bundle --version -call %EMBEDDED_BIN_DIR%\rspec --version - -SET PATH=C:\opscode\%PROJECT_NAME%\bin;C:\opscode\%PROJECT_NAME%\embedded\bin;%PATH% - -REM ; Test against the vendored chef gem (cd into the output of "gem which chef") -for /f "delims=" %%a in ('gem which chef') do set CHEFDIR=%%a -call :dirname "%CHEFDIR%" CHEFDIR -call :dirname "%CHEFDIR%" CHEFDIR -cd %CHEFDIR% - -cd - -IF "%PIPELINE_NAME%" == "chef-fips" ( - set CHEF_FIPS=1 -) - -REM ; ffi-yajl must run in c-extension mode for perf, so force it so we don't accidentally fall back to ffi -set FORCE_FFI_YAJL=ext - -call %EMBEDDED_BIN_DIR%\bundle install -call %EMBEDDED_BIN_DIR%\bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/functional - -GOTO :EOF - -:dirname file varName - setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION - SET _dir=%~dp1 - SET _dir=%_dir:~0,-1% - endlocal & set %2=%_dir% -GOTO thout:EOF diff --git a/ci/verify-chef.sh b/ci/verify-chef.sh deleted file mode 100755 index 105e8f267d..0000000000 --- a/ci/verify-chef.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh - -set -evx - -# Our tests hammer YUM pretty hard and the EL6 testers get corrupted -# after some period of time. Rebuilding the RPM database clears -# up the underlying corruption. We'll do this each test run just to -# be safe. -if [ -f /etc/redhat-release ]; then - major_version=`sed 's/^.\+ release \([0-9]\+\).*/\1/' /etc/redhat-release` - if [ "$major_version" -lt "7" ]; then - sudo rm -rf /var/lib/rpm/__db* - sudo db_verify /var/lib/rpm/Packages - sudo rpm --rebuilddb - sudo yum clean all - fi -fi - -# Set up a custom tmpdir, and clean it up before and after the tests -TMPDIR="${TMPDIR:-/tmp}/cheftest" -export TMPDIR -sudo rm -rf $TMPDIR -mkdir -p $TMPDIR - -# Verify that we kill any orphaned test processes. Kill any orphaned rspec processes. -ps ax | egrep 'rspec' | grep -v grep | awk '{ print $1 }' | xargs sudo kill -s KILL || true - -# $PROJECT_NAME is set by Jenkins, this allows us to use the same script to verify -# Chef and Angry Chef -PATH=/opt/$PROJECT_NAME/bin:$PATH -export PATH - -BIN_DIR=/opt/$PROJECT_NAME/bin -export BIN_DIR - -# We don't want to add the embedded bin dir to the main PATH as this -# could mask issues in our binstub shebangs. -EMBEDDED_BIN_DIR=/opt/$PROJECT_NAME/embedded/bin -export EMBEDDED_BIN_DIR - -# If we are on Mac our symlinks are located under /usr/local/bin -# otherwise they are under /usr/bin -if [ -f /usr/bin/sw_vers ]; then - USR_BIN_DIR="/usr/local/bin" -else - USR_BIN_DIR="/usr/bin" -fi -export USR_BIN_DIR - -# sanity check that we're getting the correct symlinks from the pre-install script -# solaris doesn't have readlink or test -e. ls -n is different on BSD. proceed with caution. -if [ ! -L $USR_BIN_DIR/chef-client ] || [ `ls -l $USR_BIN_DIR/chef-client | awk '{print$NF}'` != "$BIN_DIR/chef-client" ]; then - echo "$USR_BIN_DIR/chef-client symlink to $BIN_DIR/chef-client was not correctly created by the pre-install script!" - exit 1 -fi - -if [ ! -L $USR_BIN_DIR/knife ] || [ `ls -l $USR_BIN_DIR/knife | awk '{print$NF}'` != "$BIN_DIR/knife" ]; then - echo "$USR_BIN_DIR/knife symlink to $BIN_DIR/knife was not correctly created by the pre-install script!" - exit 1 -fi - -if [ ! -L $USR_BIN_DIR/chef-solo ] || [ `ls -l $USR_BIN_DIR/chef-solo | awk '{print$NF}'` != "$BIN_DIR/chef-solo" ]; then - echo "$USR_BIN_DIR/chef-solo symlink to $BIN_DIR/chef-solo was not correctly created by the pre-install script!" - exit 1 -fi - -if [ ! -L $USR_BIN_DIR/ohai ] || [ `ls -l $USR_BIN_DIR/ohai | awk '{print$NF}'` != "$BIN_DIR/ohai" ]; then - echo "$USR_BIN_DIR/ohai symlink to $BIN_DIR/ohai was not correctly created by the pre-install script!" - exit 1 -fi - -# Ensure the calling environment (disapproval look Bundler) does not -# infect our Ruby environment created by the `chef-client` cli. -for ruby_env_var in _ORIGINAL_GEM_PATH \ - BUNDLE_BIN_PATH \ - BUNDLE_GEMFILE \ - GEM_HOME \ - GEM_PATH \ - GEM_ROOT \ - RUBYLIB \ - RUBYOPT \ - RUBY_ENGINE \ - RUBY_ROOT \ - RUBY_VERSION \ - BUNDLER_VERSION - -do - unset $ruby_env_var -done - -chef-client --version - -# Exercise various packaged tools to validate binstub shebangs -$EMBEDDED_BIN_DIR/ruby --version -$EMBEDDED_BIN_DIR/gem --version -$EMBEDDED_BIN_DIR/bundle --version -$EMBEDDED_BIN_DIR/rspec --version - -# ffi-yajl must run in c-extension mode or we take perf hits, so we force it -# before running rspec so that we don't wind up testing the ffi mode -FORCE_FFI_YAJL=ext -export FORCE_FFI_YAJL - -OLD_PATH=$PATH -PATH=/opt/$PROJECT_NAME/bin:/opt/$PROJECT_NAME/embedded/bin:$PATH - -gem_list=`gem which chef` -lib_dir=`dirname $gem_list` -CHEF_GEM=`dirname $lib_dir` - - -cd $CHEF_GEM -sudo bundle install -sudo bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o $WORKSPACE/test.xml -f documentation spec/functional diff --git a/habitat-packages/scaffolding-chef/README.md b/habitat-packages/scaffolding-chef/README.md deleted file mode 100644 index e75a9391bf..0000000000 --- a/habitat-packages/scaffolding-chef/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Chef Scaffolding for Habitat - -This will take a Chef policy file, and build it for use as a habitat service. - -``` -scaffold_policy_name="base" -pkg_name=chef-base -pkg_origin=adam -pkg_version="0.1.0" -pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>" -pkg_license=("Apache-2.0") -pkg_description="The Chef $scaffold_policy_name Policy" -pkg_upstream_url="http://chef.io" -pkg_scaffolding="core/scaffolding-chef" -``` diff --git a/habitat-packages/scaffolding-chef/lib/scaffolding.ps1 b/habitat-packages/scaffolding-chef/lib/scaffolding.ps1 deleted file mode 100644 index d4107a01aa..0000000000 --- a/habitat-packages/scaffolding-chef/lib/scaffolding.ps1 +++ /dev/null @@ -1,132 +0,0 @@ -# -# A scaffolding for Chef Policyfile packages -# - -if (!$scaffold_policy_name) { - Write-Host "You must set `$scaffold_policy_name to a valid policy name. For example:`n `$scaffold_policy_name=base `n Will build a base.rb policyfile." - exit 1 -} - -function Load-Scaffolding { - $scaffold_chef_client = "stuartpreston/chef-client-detox" - $scaffold_chef_dk = "core/chef-dk" - - $pkg_deps += @("$scaffold_chef_client", "core/cacerts") - $pkg_build_deps += @("$scaffold_chef_dk", "core/git") - $pkg_svc_run = "set_just_so_you_will_render" -} - -function Invoke-DefaultBuildService { - New-Item -ItemType directory -Path "$pkg_prefix/hooks" - - Add-Content -Path "$pkg_prefix/hooks/run" -Value @" -function Invoke-ChefClient { - {{pkgPathFor "stuartpreston/chef-client-detox"}}/bin/chef-client.bat -z -l {{cfg.log_level}} -c $pkg_svc_config_path/client-config.rb -j $pkg_svc_config_path/attributes.json --once --no-fork --run-lock-timeout {{cfg.run_lock_timeout}} -} - -`$splay_duration = Get-Random -InputObject (0..{{cfg.splay}}) -Count 1 - -`$splay_first_run_duration = Get-Random -InputObject (0..{{cfg.splay_first_run}}) -Count 1 - -`$env:SSL_CERT_FILE="{{pkgPathFor "core/cacerts"}}/ssl/cert.pem" - -cd {{pkg.path}} - -Start-Sleep -Seconds `$splay_first_run_duration -Invoke-ChefClient - -while(`$true){ - Start-Sleep -Seconds `$splay_duration - Start-Sleep -Seconds {{cfg.interval}} - Invoke-ChefClient -} -"@ -} - - -function Invoke-DefaultBuild { - if (!(Test-Path -Path "$scaffold_policyfile_path")) { - Write-BuildLine "Could not detect a policyfiles directory, this is required to proceed!" - exit 1 - } - - Remove-Item "$scaffold_policyfile_path/*.lock.json" -Force - $policyfile = "$scaffold_policyfile_path/$scaffold_policy_name.rb" - - Get-Content $policyfile | ? { $_.StartsWith("include_policy") } | % { - $p = $_.Split()[1] - $p = $p.Replace("`"", "").Replace(",", "") - Write-BuildLine "Detected included policyfile, $p.rb, installing" - chef install "$scaffold_policyfile_path/$p.rb" - } - Write-BuildLine "Installing $policyfile" - chef install "$policyfile" -} - -function Invoke-DefaultInstall { - Write-BuildLine "Exporting Chef Infra Repository" - chef export "$scaffold_policyfile_path/$scaffold_policy_name.lock.json" "$pkg_prefix" - - Write-BuildLine "Creating Chef Infra configuration" - New-Item -ItemType directory -Path "$pkg_prefix/config" - Add-Content -Path "$pkg_prefix/.chef/config.rb" -Value @" -cache_path "$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$pkg_svc_data_path/cache").Replace("\","/"))" -node_path "$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$pkg_svc_data_path/nodes").Replace("\","/"))" -role_path "$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$pkg_svc_data_path/roles").Replace("\","/"))" -chef_zero.enabled true -ENV['PSModulePath'] += "C:/Program\ Files/WindowsPowerShell/Modules" -"@ - - Write-BuildLine "Creating initial bootstrap configuration" - Copy-Item -Path "$pkg_prefix/.chef/config.rb" -Destination "$pkg_prefix/config/bootstrap-config.rb" - Add-Content -Path "$pkg_prefix/config/bootstrap-config.rb" -Value @" -ENV['PATH'] += ";C:/WINDOWS;C:/WINDOWS/system32/;C:/WINDOWS/system32/WindowsPowerShell/v1.0;C:/ProgramData/chocolatey/bin" -"@ - - Write-BuildLine "Creating Chef Infra client configuration" - Copy-Item -Path "$pkg_prefix/.chef/config.rb" -Destination "$pkg_prefix/config/client-config.rb" - Add-Content -Path "$pkg_prefix/config/client-config.rb" -Value @" -ssl_verify_mode {{cfg.ssl_verify_mode}} -ENV['PATH'] += "{{cfg.env_path_prefix}}" - -{{#if cfg.data_collector.enable ~}} -chef_guid "{{sys.member_id}}" -data_collector.token "{{cfg.data_collector.token}}" -data_collector.server_url "{{cfg.data_collector.server_url}}" -{{/if ~}} -"@ - - Write-BuildLine "Generating config/attributes.json" - Add-Content -Path "$pkg_prefix/config/attributes.json" -Value @" -{{#if cfg.attributes}} -{{toJson cfg.attributes}} -{{else ~}} -{} -{{/if ~}} -"@ - - Write-BuildLine "Generating Chef Habiat configuration, default.toml" - Add-Content -Path "$pkg_prefix/default.toml" -Value @" -interval = 1800 -splay = 1800 -splay_first_run = 0 -run_lock_timeout = 1800 -log_level = "warn" -env_path_prefix = ";C:/WINDOWS;C:/WINDOWS/system32/;C:/WINDOWS/system32/WindowsPowerShell/v1.0;C:/ProgramData/chocolatey/bin" -ssl_verify_mode = ":verify_peer" - -[chef_license] -acceptance = "undefined" - -[data_collector] -enable = false -token = "set_to_your_token" -server_url = "set_to_your_url" -"@ - - $scaffold_data_bags_path = "not_using_data_bags" # Set default to some string so Test-Path returns false instead of error. Thanks Powershell! - if (Test-Path "$scaffold_data_bags_path") { - Write-BuildLine "Detected a data bags directory, installing into package" - Copy-Item "$scaffold_data_bags_path/*" -Destination "$pkg_prefix" -Recurse - } -} diff --git a/habitat-packages/scaffolding-chef/lib/scaffolding.sh b/habitat-packages/scaffolding-chef/lib/scaffolding.sh deleted file mode 100644 index 7c098ff1cf..0000000000 --- a/habitat-packages/scaffolding-chef/lib/scaffolding.sh +++ /dev/null @@ -1,189 +0,0 @@ -# -# A scaffolding for Chef Policyfile packages -# - -if [ -z "${scaffold_policy_name+x}" ]; then - echo "You must set \$scaffold_policy_name to a valid policy name. For example:" - echo - echo "\$scaffold_policy_name=base" - echo - echo "Will build a base.rb policyfile" - exit 1 -fi - -scaffolding_load() { - : "${scaffold_chef_client:=chef/chef-client}" - : "${scaffold_chef_dk:=chef/chef-dk}" - : "${scaffold_policyfiles_path:=$PLAN_CONTEXT/../policyfiles}" - : "${scaffold_data_bags_path:=$PLAN_CONTEXT/../data_bags}" - - pkg_deps=( - "${pkg_deps[@]}" - "${scaffold_chef_client}" - "core/cacerts" - ) - pkg_build_deps=( - "${pkg_build_deps[@]}" - "${scaffold_chef_dk}" - "core/git" - ) - - pkg_svc_user="root" - pkg_svc_run="set_just_so_you_will_render" -} - -do_default_download() { - return 0 -} - -do_default_verify() { - return 0 -} - -do_default_unpack() { - return 0 -} - -do_default_build_service() { - ## Create hooks - build_line "Creating lifecycle hooks" - mkdir -p "${pkg_prefix}/hooks" - chmod 0750 "${pkg_prefix}/hooks" - - # Run hook - cat << EOF >> "${pkg_prefix}/hooks/run" -#!/bin/sh - -CFG_ENV_PATH_PREFIX={{cfg.env_path_prefix}} -CFG_ENV_PATH_PREFIX="\${CFG_ENV_PATH_PREFIX:-/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin}" -CFG_INTERVAL={{cfg.interval}} -CFG_INTERVAL="\${CFG_INTERVAL:-1800}" -CFG_LOG_LEVEL={{cfg.log_level}} -CFG_LOG_LEVEL="\${CFG_LOG_LEVEL:-warn}" -CFG_RUN_LOCK_TIMEOUT={{cfg.run_lock_timeout}} -CFG_RUN_LOCK_TIMEOUT="\${CFG_RUN_LOCK_TIMEOUT:-1800}" -CFG_SPLAY={{cfg.splay}} -CFG_SPLAY="\${CFG_SPLAY:-1800}" -CFG_SPLAY_FIRST_RUN={{cfg.splay_first_run}} -CFG_SPLAY_FIRST_RUN="\${CFG_SPLAY_FIRST_RUN:-0}" -CFG_SSL_VERIFY_MODE={{cfg.ssl_verify_mode}} -CFG_SSL_VERIFY_MODE="\${CFG_SSL_VERIFY_MODE:-:verify_peer}" - -chef_client_cmd() -{ - chef-client -z -l \$CFG_LOG_LEVEL -c $pkg_svc_config_path/client-config.rb -j $pkg_svc_config_path/attributes.json --once --no-fork --run-lock-timeout \$CFG_RUN_LOCK_TIMEOUT -} - -SPLAY_DURATION=\$(shuf -i 0-\$CFG_SPLAY -n 1) - -SPLAY_FIRST_RUN_DURATION=\$(shuf -i 0-\$CFG_SPLAY_FIRST_RUN -n 1) - -export SSL_CERT_FILE="{{pkgPathFor "core/cacerts"}}/ssl/cert.pem" - -cd {{pkg.path}} - -exec 2>&1 -sleep \$SPLAY_FIRST_RUN_DURATION -chef_client_cmd - -while true; do - -sleep \$SPLAY_DURATION -sleep \$CFG_INTERVAL -chef_client_cmd -done -EOF - - chmod 0750 "${pkg_prefix}/hooks/run" -} - -do_default_build() { - if [ ! -d "${scaffold_policyfiles_path}" ]; then - build_line "Could not detect a policyfiles directory, this is required to proceed!" - exit 1 - fi - - rm -f "${scaffold_policyfiles_path}"/*.lock.json - - policyfile="${scaffold_policyfiles_path}/${scaffold_policy_name}.rb" - - for p in $(grep include_policy "${policyfile}" | awk -F "," '{print $1}' | awk -F '"' '{print $2}' | tr -d " "); do - build_line "Detected included policyfile, ${p}.rb, installing" - chef install "${scaffold_policyfiles_path}/${p}.rb" - done - - build_line "Installing ${policyfile}" - chef install "${policyfile}" -} - -do_default_install() { - build_line "Exporting Chef Infra Repository" - chef export "${scaffold_policyfiles_path}/${scaffold_policy_name}.lock.json" "${pkg_prefix}" - - build_line "Creating Chef Infra configuration" - mkdir -p "${pkg_prefix}/config" - chmod 0750 "${pkg_prefix}/config" - cat << EOF >> "${pkg_prefix}/.chef/config.rb" -cache_path "$pkg_svc_data_path/cache" -node_path "$pkg_svc_data_path/nodes" -role_path "$pkg_svc_data_path/roles" - -chef_zero.enabled true -EOF - - build_line "Creating initial bootstrap configuration" - cp "${pkg_prefix}/.chef/config.rb" "${pkg_prefix}/config/bootstrap-config.rb" - cat << EOF >> "${pkg_prefix}/config/bootstrap-config.rb" -ENV['PATH'] = "/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:#{ENV['PATH']}" -EOF - - build_line "Creating Chef Infra client configuration" - cp "${pkg_prefix}/.chef/config.rb" "${pkg_prefix}/config/client-config.rb" - cat << EOF >> "${pkg_prefix}/config/client-config.rb" -ssl_verify_mode {{cfg.ssl_verify_mode}} -ENV['PATH'] = "{{cfg.env_path_prefix}}:#{ENV['PATH']}" - -{{#if cfg.data_collector.enable ~}} -chef_guid "{{sys.member_id}}" -data_collector.token "{{cfg.data_collector.token}}" -data_collector.server_url "{{cfg.data_collector.server_url}}" -{{/if ~}} -EOF - chmod 0640 "${pkg_prefix}/config/client-config.rb" - - build_line "Generating config/attributes.json" - cat << EOF >> "${pkg_prefix}/config/attributes.json" -{{#if cfg.attributes ~}} -{{toJson cfg.attributes}} -{{else ~}} -{} -{{/if ~}} -EOF - - build_line "Generating Chef Habitat configuration, default.toml" - cat << EOF >> "${pkg_prefix}/default.toml" -interval = 1800 -splay = 1800 -splay_first_run = 0 -run_lock_timeout = 1800 -log_level = "warn" -chef_client_ident = "" # this is blank by default so it can be populated from the bind -env_path_prefix = "/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin" -ssl_verify_mode = ":verify_peer" - -[data_collector] -enable = false -token = "set_to_your_token" -server_url = "set_to_your_url" -EOF - chmod 0640 "${pkg_prefix}/default.toml" - - if [ -d "${scaffold_data_bags_path}" ]; then - build_line "Detected a data bags directory, installing into package" - cp -a "${scaffold_data_bags_path}" "${pkg_prefix}" - fi -} - -do_default_strip() { - return 0 -} diff --git a/habitat-packages/scaffolding-chef/plan.ps1 b/habitat-packages/scaffolding-chef/plan.ps1 deleted file mode 100644 index d61241056a..0000000000 --- a/habitat-packages/scaffolding-chef/plan.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -$pkg_name="scaffolding-chef" -$pkg_description="Scaffolding for Chef Policyfiles" -$pkg_origin="chef" -$pkg_version="0.6.0" -$pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>" -$pkg_license=("Apache-2.0") -$pkg_upstream_url="https://www.chef.sh" -$pkg_build_deps=@( - "core/chefdk" - "core/git" - ) -function Invoke-Install { - New-Item -ItemType directory -Path "${pkg_prefix}/lib" - Copy-Item -Path "$PLAN_CONTEXT/lib/scaffolding.ps1" -Destination "$pkg_prefix/lib/scaffolding.ps1" -} diff --git a/habitat-packages/scaffolding-chef/plan.sh b/habitat-packages/scaffolding-chef/plan.sh deleted file mode 100644 index d3d49dfdc3..0000000000 --- a/habitat-packages/scaffolding-chef/plan.sh +++ /dev/null @@ -1,28 +0,0 @@ -pkg_name=scaffolding-chef -pkg_description="Scaffolding for Chef Policyfiles" -pkg_origin=chef -pkg_version="0.5.0" -pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>" -pkg_license=('Apache-2.0') -pkg_source=nope -pkg_upstream_url="https://www.chef.sh" - -do_download() { - return 0 -} - -do_verify() { - return 0 -} - -do_unpack() { - return 0 -} - -do_build() { - return 0 -} - -do_install() { - install -D -m 0644 "$PLAN_CONTEXT/lib/scaffolding.sh" "$pkg_prefix/lib/scaffolding.sh" -} diff --git a/lib/chef/version.rb b/lib/chef/version.rb index 0ab0fd40f3..cb550b8066 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require_relative "version_string" class Chef CHEF_ROOT = File.expand_path("../..", __FILE__) - VERSION = Chef::VersionString.new("15.1.21") + VERSION = Chef::VersionString.new("15.1.26") end # diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock index f922fef519..19242db542 100644 --- a/omnibus/Gemfile.lock +++ b/omnibus/Gemfile.lock @@ -32,17 +32,17 @@ GEM public_suffix (>= 2.0.2, < 4.0) awesome_print (1.8.0) aws-eventstream (1.0.3) - aws-partitions (1.175.0) - aws-sdk-core (3.55.0) + aws-partitions (1.178.0) + aws-sdk-core (3.56.0) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.21.0) - aws-sdk-core (~> 3, >= 3.53.0) + aws-sdk-kms (1.22.0) + aws-sdk-core (~> 3, >= 3.56.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.42.0) - aws-sdk-core (~> 3, >= 3.53.0) + aws-sdk-s3 (1.43.0) + aws-sdk-core (~> 3, >= 3.56.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) aws-sigv4 (1.1.0) @@ -154,14 +154,14 @@ GEM concurrent-ruby (1.1.5) diff-lcs (1.3) ed25519 (1.2.4) - equatable (0.5.0) + equatable (0.6.0) erubis (2.7.0) faraday (0.15.4) multipart-post (>= 1.2, < 3) ffi (1.11.1) ffi (1.11.1-x64-mingw32) ffi (1.11.1-x86-mingw32) - ffi-libarchive (0.4.6) + ffi-libarchive (0.4.10) ffi (~> 1.0) ffi-win32-extensions (1.0.3) ffi @@ -233,7 +233,7 @@ GEM nori (2.6.0) octokit (4.14.0) sawyer (~> 0.8.0, >= 0.5.3) - ohai (15.1.3) + ohai (15.1.5) chef-config (>= 12.8, < 16) ffi (~> 1.9) ffi-yajl (~> 2.2) @@ -245,9 +245,9 @@ GEM plist (~> 3.1) systemu (~> 2.6.4) wmi-lite (~> 1.0) - pastel (0.7.2) - equatable (~> 0.5.0) - tty-color (~> 0.4.0) + pastel (0.7.3) + equatable (~> 0.6) + tty-color (~> 0.5) pedump (0.5.2) awesome_print iostruct (>= 0.0.4) @@ -306,7 +306,7 @@ GEM pastel (~> 0.7.2) strings (~> 0.1.5) tty-cursor (~> 0.7) - tty-color (0.4.3) + tty-color (0.5.0) tty-cursor (0.7.0) tty-prompt (0.19.0) necromancer (~> 0.5.0) diff --git a/omnibus/omnibus-test.ps1 b/omnibus/omnibus-test.ps1 index 8e826cfb77..b6f054370c 100644 --- a/omnibus/omnibus-test.ps1 +++ b/omnibus/omnibus-test.ps1 @@ -28,6 +28,20 @@ $Env:TMP = "C:\cheftest" Remove-Item -Recurse -Force $Env:TEMP -ErrorAction SilentlyContinue New-Item -ItemType directory -Path $Env:TEMP +# FIXME: we should really use Bundler.with_clean_env in the caller instead of re-inventing it here +Remove-Item Env:_ORIGINAL_GEM_PATH -ErrorAction SilentlyContinue +Remove-Item Env:BUNDLE_BIN_PATH -ErrorAction SilentlyContinue +Remove-Item Env:BUNDLE_GEMFILE -ErrorAction SilentlyContinue +Remove-Item Env:GEM_HOME -ErrorAction SilentlyContinue +Remove-Item Env:GEM_PATH -ErrorAction SilentlyContinue +Remove-Item Env:GEM_ROOT -ErrorAction SilentlyContinue +Remove-Item Env:RUBYLIB -ErrorAction SilentlyContinue +Remove-Item Env:RUBYOPT -ErrorAction SilentlyContinue +Remove-Item Env:RUBY_ENGINE -ErrorAction SilentlyContinue +Remove-Item Env:RUBY_ROOT -ErrorAction SilentlyContinue +Remove-Item Env:RUBY_VERSION -ErrorAction SilentlyContinue +Remove-Item Env:BUNDLER_VERSION -ErrorAction SilentlyContinue + ForEach ($b in "chef-client", "knife", diff --git a/omnibus/omnibus-test.sh b/omnibus/omnibus-test.sh index 4b5ca82895..95ac30bec4 100644 --- a/omnibus/omnibus-test.sh +++ b/omnibus/omnibus-test.sh @@ -93,6 +93,25 @@ if [[ ! -L $USR_BIN_DIR/ohai ]] || [[ $(ls -l $USR_BIN_DIR/ohai | awk '{print$NF exit 1 fi +# Ensure the calling environment (disapproval look Bundler) does not +# infect our Ruby environment created by the `chef-client` cli. +for ruby_env_var in _ORIGINAL_GEM_PATH \ + BUNDLE_BIN_PATH \ + BUNDLE_GEMFILE \ + GEM_HOME \ + GEM_PATH \ + GEM_ROOT \ + RUBYLIB \ + RUBYOPT \ + RUBY_ENGINE \ + RUBY_ROOT \ + RUBY_VERSION \ + BUNDLER_VERSION + +do + unset $ruby_env_var +done + chef-client --version # Exercise various packaged tools to validate binstub shebangs diff --git a/omnibus_overrides.rb b/omnibus_overrides.rb index c5655f9acf..1ec6417074 100644 --- a/omnibus_overrides.rb +++ b/omnibus_overrides.rb @@ -4,7 +4,7 @@ # # NOTE: You MUST update omnibus-software when adding new versions of # software here: bundle exec rake dependencies:update_omnibus_gemfile_lock -override :rubygems, version: "3.0.3" +override :rubygems, version: "3.0.4" override :bundler, version: "1.17.2" # currently pinned to what ships in Ruby to prevent double bundler override "nokogiri", version: "1.10.2" override "libffi", version: "3.2.1" diff --git a/spec/functional/resource/insserv_spec.rb b/spec/functional/resource/insserv_spec.rb index a923753019..55a803d431 100644 --- a/spec/functional/resource/insserv_spec.rb +++ b/spec/functional/resource/insserv_spec.rb @@ -75,6 +75,7 @@ describe Chef::Resource::Service, :requires_root, :sles11 do before(:all) do File.delete("/etc/init.d/inittest") if File.exists?("/etc/init.d/inittest") FileUtils.cp((File.join(File.dirname(__FILE__), "/../assets/inittest")).to_s, "/etc/init.d/inittest") + FileUtils.chmod(0755, "/etc/init.d/inittest") end after(:all) do |