Skip to content

Commit 94438d1

Browse files
committed
Require Ruby 2.6 or later
Our policy in general has been N-1 on Ruby releases when there is a conflict that prevents us from supporting older releases. Ohai pulls in chef-config, which requires Ruby 2.6+ now. Signed-off-by: Tim Smith <[email protected]>
1 parent 15796ff commit 94438d1

File tree

6 files changed

+12
-64
lines changed

6 files changed

+12
-64
lines changed

.expeditor/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Documentation available at https://expeditor.chef.io/docs/getting-started/
22
---
3+
34
# Slack channel in Chef Software slack to send notifications about build failures, etc
45
slack:
56
notify_channel:

.expeditor/run_linux_tests.sh

-37
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,12 @@
55
set -ue
66

77
export USER="root"
8-
9-
echo "--- dependencies"
108
export LANG=C.UTF-8 LANGUAGE=C.UTF-8
11-
S3_URL="s3://public-cd-buildkite-cache/${BUILDKITE_PIPELINE_SLUG}/${BUILDKITE_LABEL}"
12-
13-
pull_s3_file() {
14-
aws s3 cp "${S3_URL}/$1" "$1" || echo "Could not pull $1 from S3"
15-
}
16-
17-
push_s3_file() {
18-
if [ -f "$1" ]; then
19-
aws s3 cp "$1" "${S3_URL}/$1" || echo "Could not push $1 to S3 for caching."
20-
fi
21-
}
22-
23-
apt-get update -y
24-
apt-get install awscli -y
259

2610
echo "--- bundle install"
27-
pull_s3_file "bundle.tar.gz"
28-
pull_s3_file "bundle.sha256"
29-
30-
if [ -f bundle.tar.gz ]; then
31-
tar -xzf bundle.tar.gz
32-
fi
33-
34-
if [ -n "${RESET_BUNDLE_CACHE:-}" ]; then
35-
rm bundle.sha256
36-
fi
3711

3812
bundle config --local path vendor/bundle
3913
bundle install --jobs=7 --retry=3
4014

41-
echo "--- bundle cache"
42-
if test -f bundle.sha256 && shasum --check bundle.sha256 --status; then
43-
echo "Bundled gems have not changed. Skipping upload to s3"
44-
else
45-
echo "Bundled gems have changed. Uploading to s3"
46-
shasum -a 256 Gemfile.lock > bundle.sha256
47-
tar -czf bundle.tar.gz vendor/
48-
push_s3_file bundle.tar.gz
49-
push_s3_file bundle.sha256
50-
fi
51-
5215
echo "+++ bundle exec task"
5316
bundle exec $@

.expeditor/verify.pipeline.yml

+2-19
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,15 @@
11
---
22
expeditor:
3+
cached_folders:
4+
- vendor
35
defaults:
46
buildkite:
57
retry:
68
automatic:
79
limit: 1
810
timeout_in_minutes: 30
9-
retry:
10-
automatic:
11-
limit: 1
1211

1312
steps:
14-
- label: run-lint-and-specs-ruby-2.4
15-
command:
16-
- .expeditor/run_linux_tests.sh rake
17-
expeditor:
18-
executor:
19-
docker:
20-
image: ruby:2.4-buster
21-
22-
- label: run-lint-and-specs-ruby-2.5
23-
command:
24-
- .expeditor/run_linux_tests.sh rake
25-
expeditor:
26-
executor:
27-
docker:
28-
image: ruby:2.5-buster
29-
3013
- label: run-lint-and-specs-ruby-2.6
3114
command:
3215
- .expeditor/run_linux_tests.sh rake

.rubocop.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
AllCops:
2+
TargetRubyVersion: 2.6
3+
14
# all of these could/should be corrected. Have at it if you want.
25

36
Layout/ClosingHeredocIndentation:

lib/omnibus/build_version_dsl.rb

+4-6
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,10 @@ def has_timestamp?(version)
136136
return false if build_info.nil?
137137

138138
build_info.split(".").any? do |part|
139-
begin
140-
Time.strptime(part, Omnibus::BuildVersion::TIMESTAMP_FORMAT)
141-
true
142-
rescue ArgumentError
143-
false
144-
end
139+
Time.strptime(part, Omnibus::BuildVersion::TIMESTAMP_FORMAT)
140+
true
141+
rescue ArgumentError
142+
false
145143
end
146144
end
147145

omnibus.gemspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
1212
gem.description = gem.summary
1313
gem.homepage = "https://github.com/chef/omnibus"
1414

15-
gem.required_ruby_version = ">= 2.4"
15+
gem.required_ruby_version = ">= 2.6"
1616

1717
gem.files = %w{ LICENSE README.md Rakefile Gemfile } + Dir.glob("*.gemspec") + Dir.glob("{bin,lib,resources,spec}/**/{*,.kitchen*}")
1818
gem.bindir = "bin"
@@ -25,7 +25,7 @@ Gem::Specification.new do |gem|
2525
gem.add_dependency "chef-cleanroom", "~> 1.0"
2626
gem.add_dependency "ffi-yajl", "~> 2.2"
2727
gem.add_dependency "mixlib-shellout", ">= 2.0", "< 4.0"
28-
gem.add_dependency "ohai", ">= 13", "< 17"
28+
gem.add_dependency "ohai", ">= 15"
2929
gem.add_dependency "ruby-progressbar", "~> 1.7"
3030
gem.add_dependency "thor", ">= 0.18", "< 2.0"
3131
gem.add_dependency "license_scout", "~> 1.0"

0 commit comments

Comments
 (0)