From 25018f8559b991e1e2bb0a2d7da249b18ebfc742 Mon Sep 17 00:00:00 2001 From: kasif Date: Fri, 29 Apr 2022 15:35:24 +0530 Subject: [PATCH 1/3] support ruby 3 Signed-off-by: kasif --- .expeditor/verify.pipeline.yml | 20 ++++++-------------- Gemfile | 1 + stove.gemspec | 2 +- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 6861cc4..42f0d67 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -1,33 +1,25 @@ steps: -- label: run-specs-ruby-2.3 +- label: run-specs-ruby-2.7 command: - .expeditor/run_linux_tests.sh "rake" expeditor: executor: docker: - image: ruby:2.3 + image: ruby:2.7 -- label: run-specs-ruby-2.4 +- label: run-specs-ruby-3.0 command: - .expeditor/run_linux_tests.sh "rake" expeditor: executor: docker: - image: ruby:2.4-buster + image: ruby:3.0 -- label: run-specs-ruby-2.5 +- label: run-specs-ruby-3.1 command: - .expeditor/run_linux_tests.sh "rake" expeditor: executor: docker: - image: ruby:2.5-buster - -- label: run-specs-ruby-2.6 - command: - - .expeditor/run_linux_tests.sh "rake" - expeditor: - executor: - docker: - image: ruby:2.6-buster + image: ruby:3.1 diff --git a/Gemfile b/Gemfile index 8c061dc..cf28b7d 100644 --- a/Gemfile +++ b/Gemfile @@ -3,3 +3,4 @@ gemspec name: 'stove' # testing compatibility gem 'rack', '< 2' +gem 'webrick' diff --git a/stove.gemspec b/stove.gemspec index a941d40..a29f58d 100644 --- a/stove.gemspec +++ b/stove.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| spec.executables = 'stove' spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 2.3' + spec.required_ruby_version = '>= 2.7' # Runtime dependencies spec.add_dependency 'chef-api', '~> 0.5' From 947cce05f50d01401f1f899b704c414892a87c55 Mon Sep 17 00:00:00 2001 From: kasif Date: Fri, 29 Apr 2022 16:20:51 +0530 Subject: [PATCH 2/3] clean script Signed-off-by: kasif #clean scriptt --- .expeditor/run_linux_tests.sh | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/.expeditor/run_linux_tests.sh b/.expeditor/run_linux_tests.sh index 9b6b097..7dea273 100755 --- a/.expeditor/run_linux_tests.sh +++ b/.expeditor/run_linux_tests.sh @@ -10,38 +10,10 @@ export USER="root" apt-get update -y apt-get install awscli -y -# grab the s3 bundler if it's there and use it for all operations in bundler -echo "Fetching bundle cache archive from s3://public-cd-buildkite-cache/${BUILDKITE_PIPELINE_SLUG}/${BUILDKITE_LABEL}/bundle.tar.gz" -aws s3 cp "s3://public-cd-buildkite-cache/${BUILDKITE_PIPELINE_SLUG}/${BUILDKITE_LABEL}/bundle.tar.gz" bundle.tar.gz || echo 'Could not pull the bundler archive from s3 for caching. Builds may be slower than usual as all gems will have to install.' -aws s3 cp "s3://public-cd-buildkite-cache/${BUILDKITE_PIPELINE_SLUG}/${BUILDKITE_LABEL}/bundle.sha256" bundle.sha256 || echo "Could not pull the sha256 hash of the vendor/bundle directory from s3. Without this we will compress and upload the bundler archive to S3 even if it hasn't changed" - -echo "Restoring the bundle cache archive to vendor/bundle" -if [ -f bundle.tar.gz ]; then - tar -xzf bundle.tar.gz -fi - git config --global user.email "foo@example.com" git config --global user.name "Foo Bar" bundle config --local path vendor/bundle bundle install --jobs=7 --retry=3 +echo "bundle exec task" bundle exec $1 - -if [[ -f bundle.tar.gz && -f bundle.sha256 ]]; then # dont' check the sha if we're missing either file - if shasum --check bundle.sha256 --status; then # if the the sha matches we're done - echo "Bundled gems have not changed. Skipping upload to s3" - exit - fi -fi - -echo "Generating sha256 hash file of the vendor/bundle directory to ship to s3" -shasum -a 256 vendor/bundle > bundle.sha256 - -echo "Creating the tar.gz to of the vendor/bundle directory to ship to s3" -tar -czf bundle.tar.gz vendor/ - -echo "Uploading the tar.gz of the vendor/bundle directory to s3" -aws s3 cp bundle.tar.gz "s3://public-cd-buildkite-cache/${BUILDKITE_PIPELINE_SLUG}/${BUILDKITE_LABEL}/bundle.tar.gz" || echo 'Could not push the bundler directory to s3 for caching. Future builds may be slower if this continues.' - -echo "Uploading the sha256 hash of the vendor/bundle directory to s3" -aws s3 cp bundle.sha256 "s3://public-cd-buildkite-cache/${BUILDKITE_PIPELINE_SLUG}/${BUILDKITE_LABEL}/bundle.sha256" || echo 'Could not push the bundler directory to s3 for caching. Future builds may be slower if this continues.' From 418df51fc267cf781dff380f383f2af8224fb85b Mon Sep 17 00:00:00 2001 From: kasif Date: Fri, 29 Apr 2022 18:24:47 +0530 Subject: [PATCH 3/3] INFCT-60-try-caching Signed-off-by: kasif --- .expeditor/verify.pipeline.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index 42f0d67..d98b3ef 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -1,3 +1,14 @@ +--- +expeditor: + cached_folders: + - vendor + defaults: + buildkite: + retry: + automatic: + limit: 1 + timeout_in_minutes: 30 + steps: - label: run-specs-ruby-2.7