diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-05-09 09:39:23 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-05-09 10:16:36 -0700 |
commit | 1b1a8b34c872bc55f2acf77e44ac70e6e1efcab7 (patch) | |
tree | 3c6789905e64f7f3f9e3343a61bd4f8ce7f5a737 /ci | |
parent | 0ad389f48d43ebfc4347c41a3573ee855993c5f1 (diff) | |
download | chef-1b1a8b34c872bc55f2acf77e44ac70e6e1efcab7.tar.gz |
simplify omnibus config and greenify builds again
this is also necessary for bundler-1.14.x
i'm still not entirely clear why we ever needed all the fussy software gem
configs or what the build-chef / build-chef-gem infrastructure ever
did for us. it seems to have been mostly micro-optimization around
building the software gems before bundle installing the project in order
to take advantage of git caching. i aggressively don't care about that,
this is quite fast enough. we can install nokogiri and libgecode early
and that should take care of 98% of the build optimization issue.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/bundle_install.sh | 10 | ||||
-rwxr-xr-x | ci/dependency_update.sh | 2 | ||||
-rwxr-xr-x | ci/verify-chef.bat | 40 | ||||
-rwxr-xr-x | ci/verify-chef.sh | 26 | ||||
-rwxr-xr-x | ci/version_bump.sh | 2 |
5 files changed, 54 insertions, 26 deletions
diff --git a/ci/bundle_install.sh b/ci/bundle_install.sh index 6914189479..80e56ecbd2 100755 --- a/ci/bundle_install.sh +++ b/ci/bundle_install.sh @@ -1,10 +1,12 @@ #!/bin/sh +# FIXME: someone document what actually calls this +# FIXME: is this really the best place for this or should it go in the rake tasks? set -evx gem environment -bundler_version=$(grep bundler omnibus_overrides.rb | cut -d'"' -f2) -gem install bundler -v $bundler_version --user-install --conservative +omnibus_bundler=$(grep bundler omnibus_overrides.rb | cut -d'"' -f2) +gem uninstall bundler -a -x +gem install bundler -v $omnibus_bundler --user-install --conservative # WITH: ci (for version bumping and changelog creation) -export BUNDLE_WITHOUT=omnibus_package:test:pry:integration:docgen:maintenance:travis:aix:bsd:linux:mac_os_x:solaris:windows:development -bundle _${bundler_version}_ install +bundle install --without omnibus_package test pry integration docgen maintenance travis aix bsd linux mac_os_x solaris windows development diff --git a/ci/dependency_update.sh b/ci/dependency_update.sh index efc0b3ad2f..7930b864d8 100755 --- a/ci/dependency_update.sh +++ b/ci/dependency_update.sh @@ -1,5 +1,7 @@ #!/bin/sh +# FIXME: this seems uselessly trivial, replace with a rake task and have ci call the rake task? + set -evx . ci/bundle_install.sh diff --git a/ci/verify-chef.bat b/ci/verify-chef.bat index 7ba0817938..4ff3e0be77 100755 --- a/ci/verify-chef.bat +++ b/ci/verify-chef.bat @@ -18,6 +18,20 @@ 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 @@ -46,8 +60,15 @@ 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 "bundle show chef") -for /f "delims=" %%a in ('bundle show chef') do cd %%a +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 + +type Gemfile.lock IF NOT EXIST "Gemfile.lock" ( ECHO "Chef gem does not contain a Gemfile.lock! This is needed to run any tests." @@ -61,7 +82,14 @@ IF "%PIPELINE_NAME%" == "chef-fips" ( 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 -set BUNDLE_GEMFILE=C:\opscode\%PROJECT_NAME%\Gemfile -set BUNDLE_IGNORE_CONFIG=true -set BUNDLE_FROZEN=1 -call bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/functional +set +call %EMBEDDED_BIN_DIR%\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 index 71d4afe0df..0c90d65dbe 100755 --- a/ci/verify-chef.sh +++ b/ci/verify-chef.sh @@ -64,7 +64,8 @@ for ruby_env_var in _ORIGINAL_GEM_PATH \ RUBYOPT \ RUBY_ENGINE \ RUBY_ROOT \ - RUBY_VERSION + RUBY_VERSION \ + BUNDLER_VERSION do unset $ruby_env_var @@ -83,14 +84,17 @@ $EMBEDDED_BIN_DIR/rspec --version 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` + # ACCEPTANCE environment variable will be set on acceptance testers. # If is it set; we run the acceptance tests, otherwise run rspec tests. if [ "x$ACCEPTANCE" != "x" ]; then # Find the Chef gem and cd there. - OLD_PATH=$PATH - PATH=/opt/$PROJECT_NAME/bin:/opt/$PROJECT_NAME/embedded/bin:$PATH - cd /opt/$PROJECT_NAME - CHEF_GEM=`bundle show chef` PATH=$OLD_PATH # On acceptance testers we have Chef DK. We will use its Ruby environment @@ -109,17 +113,7 @@ if [ "x$ACCEPTANCE" != "x" ]; then env PATH=$PATH AWS_SSH_KEY_ID=$AWS_SSH_KEY_ID bundle install --deployment env PATH=$PATH AWS_SSH_KEY_ID=$AWS_SSH_KEY_ID KITCHEN_DRIVER=ec2 KITCHEN_CHEF_CHANNEL=unstable bundle exec chef-acceptance test --force-destroy --data-path $WORKSPACE/chef-acceptance-data else - PATH=/opt/$PROJECT_NAME/bin:/opt/$PROJECT_NAME/embedded/bin:$PATH - export PATH - - # Test against the installed Chef gem - cd /opt/$PROJECT_NAME - CHEF_GEM=`bundle show chef` cd $CHEF_GEM - if [ ! -f "Gemfile.lock" ]; then - echo "Chef gem does not contain a Gemfile.lock! This is needed to run any tests." - exit 1 - fi - sudo env BUNDLE_GEMFILE=/opt/$PROJECT_NAME/Gemfile BUNDLE_IGNORE_CONFIG=true BUNDLE_FROZEN=1 PATH=$PATH TERM=xterm bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o $WORKSPACE/test.xml -f documentation spec/functional + sudo bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o $WORKSPACE/test.xml -f documentation spec/functional fi diff --git a/ci/version_bump.sh b/ci/version_bump.sh index 0de6b8d40f..9e4c85ebc8 100755 --- a/ci/version_bump.sh +++ b/ci/version_bump.sh @@ -1,5 +1,7 @@ #!/bin/sh +# FIXME: this seems uselessly trivial, replace with a rake task and have ci call the rake task? + set -evx export LANG=en_US.UTF-8 |