mirror of
https://github.com/inspec/inspec
synced 2024-11-22 04:33:09 +00:00
Borrow docker setup script from chef/chef and try a single suite
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
e290877e33
commit
cf8bcfb9fa
2 changed files with 71 additions and 5 deletions
51
.expeditor/buildkite/bk_linux_exec.sh
Executable file
51
.expeditor/buildkite/bk_linux_exec.sh
Executable file
|
@ -0,0 +1,51 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Enable IPv6 in docker
|
||||
echo "--- Enabling ipv6 on docker"
|
||||
sudo systemctl stop docker
|
||||
dockerd_config="/etc/docker/daemon.json"
|
||||
sudo echo "$(jq '. + {"ipv6": true, "fixed-cidr-v6": "2001:2019:6002::/80", "ip-forward": false}' $dockerd_config)" > $dockerd_config
|
||||
sudo systemctl start docker
|
||||
|
||||
# Install C and C++
|
||||
echo "--- Installing package deps"
|
||||
sudo yum install -y gcc gcc-c++ openssl-devel readline-devel zlib-devel
|
||||
|
||||
# Install ASDF
|
||||
echo "--- Installing asdf to ${HOME}/.asdf"
|
||||
git clone https://github.com/asdf-vm/asdf.git "${HOME}/.asdf"
|
||||
cd "${HOME}/.asdf"; git checkout "$(git describe --abbrev=0 --tags)"; cd -
|
||||
. "${HOME}/.asdf/asdf.sh"
|
||||
|
||||
# Install Ruby
|
||||
ruby_version=$(sed -n '/"ruby"/{s/.*version: "//;s/"//;p;}' omnibus_overrides.rb)
|
||||
echo "--- Installing Ruby $ruby_version"
|
||||
asdf plugin add ruby
|
||||
asdf install ruby $ruby_version
|
||||
asdf global ruby $ruby_version
|
||||
|
||||
# Set Environment Variables
|
||||
export BUNDLE_GEMFILE=$PWD/Gemfile
|
||||
export FORCE_FFI_YAJL=ext
|
||||
export CHEF_LICENSE="accept-silent"
|
||||
|
||||
# Update Gems
|
||||
echo "--- Installing Gems"
|
||||
echo 'gem: --no-document' >> ~/.gemrc
|
||||
sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
|
||||
bundle install --jobs=3 --retry=3 --path=../vendor/bundle
|
||||
|
||||
echo "--- Config information"
|
||||
|
||||
echo "!!!! RUBY VERSION !!!!"
|
||||
ruby --version
|
||||
echo "!!!! BUNDLER LOCATION !!!!"
|
||||
which bundle
|
||||
echo "!!!! BUNDLER VERSION !!!!"
|
||||
bundle -v
|
||||
echo "!!!! DOCKER VERSION !!!!"
|
||||
docker version
|
||||
echo "!!!! DOCKER STATUS !!!!"
|
||||
sudo service docker status
|
||||
|
||||
echo "+++ Running tests"
|
|
@ -8,10 +8,25 @@ expeditor:
|
|||
limit: 1
|
||||
|
||||
steps:
|
||||
- label: Resource-Platform Tests
|
||||
command:
|
||||
- CONCURRENCY=3 DOCKER=1 KITCHEN_YAML=kitchen.dokken.yml RAKE_TASK=test:kitchen /workdir/.expeditor/buildkite/verify.sh
|
||||
# - label: Resource-Platform Tests
|
||||
# command:
|
||||
# - CONCURRENCY=3 DOCKER=1 KITCHEN_YAML=kitchen.dokken.yml RAKE_TASK=test:kitchen /workdir/.expeditor/buildkite/verify.sh
|
||||
# expeditor:
|
||||
# executor:
|
||||
# docker:
|
||||
# image: ruby:2.7
|
||||
|
||||
- label: "Kitchen: resources-amazonlinux-2"
|
||||
commands:
|
||||
- .expeditor/buildkite/bk_linux_exec.sh
|
||||
- . /var/lib/buildkite-agent/.asdf/asdf.sh
|
||||
- bundle exec kitchen test resources-amazonlinux-2
|
||||
artifact_paths:
|
||||
- $PWD/.kitchen/logs/kitchen.log
|
||||
env:
|
||||
KITCHEN_YAML: kitchen.dokken.yml
|
||||
expeditor:
|
||||
executor:
|
||||
docker:
|
||||
image: ruby:2.7
|
||||
linux:
|
||||
privileged: true
|
||||
single-use: true
|
||||
|
|
Loading…
Reference in a new issue