Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support ruby 3 #158

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions .expeditor/run_linux_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
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.'
31 changes: 17 additions & 14 deletions .expeditor/verify.pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
steps:
---
expeditor:
cached_folders:
- vendor
defaults:
buildkite:
retry:
automatic:
limit: 1
timeout_in_minutes: 30

- label: run-specs-ruby-2.3
command:
- .expeditor/run_linux_tests.sh "rake"
expeditor:
executor:
docker:
image: ruby:2.3
steps:

- label: run-specs-ruby-2.4
- label: run-specs-ruby-2.7
command:
- .expeditor/run_linux_tests.sh "rake"
expeditor:
executor:
docker:
image: ruby:2.4-buster
image: ruby:2.7

- label: run-specs-ruby-2.5
- label: run-specs-ruby-3.0
command:
- .expeditor/run_linux_tests.sh "rake"
expeditor:
executor:
docker:
image: ruby:2.5-buster
image: ruby:3.0

- label: run-specs-ruby-2.6
- label: run-specs-ruby-3.1
command:
- .expeditor/run_linux_tests.sh "rake"
expeditor:
executor:
docker:
image: ruby:2.6-buster
image: ruby:3.1
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ gemspec name: 'stove'

# testing compatibility
gem 'rack', '< 2'
gem 'webrick'
2 changes: 1 addition & 1 deletion stove.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down