diff options
author | Tim Smith <tsmith84@gmail.com> | 2019-12-29 17:58:53 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2019-12-29 17:58:53 -0800 |
commit | d311508d5263467e6909a322544995c0e1ec451e (patch) | |
tree | 11cee58a353eeb40c042e41714952e4ce6af8a4e /.expeditor | |
parent | 0778c7c2629e519b02842123fdbaa766911b79cd (diff) | |
download | chef-zero-d311508d5263467e6909a322544995c0e1ec451e.tar.gz |
Move testing to Buildkite
Specs and lint only for now
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to '.expeditor')
-rw-r--r-- | .expeditor/config.yml | 9 | ||||
-rwxr-xr-x | .expeditor/run_linux_tests.sh | 53 | ||||
-rw-r--r-- | .expeditor/verify.pipeline.yml | 52 |
3 files changed, 113 insertions, 1 deletions
diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 94d1e13..ff7ad8a 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -1,8 +1,9 @@ # Documentation available at https://expeditor.chef.io/docs/getting-started/ --- + # Slack channel in Chef Software slack to send notifications about build failures, etc slack: - notify_channel: chef-notify + notify_channel: chef-infra-notify # This publish is triggered by the `built_in:publish_rubygems` artifact_action. rubygems: @@ -16,6 +17,7 @@ github: # allow bumping the minor release via label minor_bump_labels: - "Expeditor: Bump Version Minor" + # allow bumping the major release via label major_bump_labels: - "Expeditor: Bump Version Major" @@ -41,3 +43,8 @@ promote: actions: - built_in:rollover_changelog - built_in:publish_rubygems + +pipelines: + - verify: + description: Pull Request validation tests + public: true diff --git a/.expeditor/run_linux_tests.sh b/.expeditor/run_linux_tests.sh new file mode 100755 index 0000000..4c14c80 --- /dev/null +++ b/.expeditor/run_linux_tests.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# This script runs a passed in command, but first setups up the bundler caching on the repo + +set -ue + +export USER="root" + +echo "--- dependencies" +export LANG=C.UTF-8 LANGUAGE=C.UTF-8 +S3_URL="s3://public-cd-buildkite-cache/${BUILDKITE_PIPELINE_SLUG}/${BUILDKITE_LABEL}" + +pull_s3_file() { + aws s3 cp "${S3_URL}/$1" "$1" || echo "Could not pull $1 from S3" +} + +push_s3_file() { + if [ -f "$1" ]; then + aws s3 cp "$1" "${S3_URL}/$1" || echo "Could not push $1 to S3 for caching." + fi +} + +apt-get update -y +apt-get install awscli -y + +echo "--- bundle install" +pull_s3_file "bundle.tar.gz" +pull_s3_file "bundle.sha256" + +if [ -f bundle.tar.gz ]; then + tar -xzf bundle.tar.gz +fi + +if [ -n "${RESET_BUNDLE_CACHE:-}" ]; then + rm bundle.sha256 +fi + +bundle config --local path vendor/bundle +bundle install --jobs=7 --retry=3 + +echo "--- bundle cache" +if test -f bundle.sha256 && shasum --check bundle.sha256 --status; then + echo "Bundled gems have not changed. Skipping upload to s3" +else + echo "Bundled gems have changed. Uploading to s3" + shasum -a 256 Gemfile.lock > bundle.sha256 + tar -czf bundle.tar.gz vendor/ + push_s3_file bundle.tar.gz + push_s3_file bundle.sha256 +fi + +echo "+++ bundle exec task" +bundle exec $1 diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml new file mode 100644 index 0000000..ba9f28a --- /dev/null +++ b/.expeditor/verify.pipeline.yml @@ -0,0 +1,52 @@ +--- +expeditor: + defaults: + buildkite: + timeout_in_minutes: 30 + +steps: + +- label: run-lint-and-specs-ruby-2.4 + command: + - apt-get update + - .expeditor/run_linux_tests.sh rake spec style + expeditor: + executor: + docker: + image: ruby:2.4-buster + +- label: run-lint-and-specs-ruby-2.5 + command: + - apt-get update + - .expeditor/run_linux_tests.sh rake spec style + expeditor: + executor: + docker: + image: ruby:2.5-buster + +- label: run-lint-and-specs-ruby-2.6 + command: + - apt-get update + - .expeditor/run_linux_tests.sh rake spec style + expeditor: + executor: + docker: + image: ruby:2.6-buster + +- label: run-lint-and-specs-ruby-2.7 + command: + - apt-get update + - .expeditor/run_linux_tests.sh rake spec style + expeditor: + executor: + docker: + image: ruby:2.7-buster + +- label: run-specs-windows + command: + - bundle install --jobs=7 --retry=3 --without docs debug + - bundle exec rake spec + expeditor: + executor: + docker: + host_os: windows |