diff options
author | Tim Smith <tsmith84@gmail.com> | 2019-08-14 09:44:38 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2019-08-14 09:44:38 -0700 |
commit | bf07fab202819b0696e2ae262ef0822689886ab4 (patch) | |
tree | 765f501b03d5e665b29f60e0105ddcd083b8279e | |
parent | 0888abc9668b5e46293ce9c48b2dbf01aa55532f (diff) | |
download | chef-testing_14.tar.gz |
Copy over buildkite scripts from mastertesting_14
Signed-off-by: Tim Smith <tsmith@chef.io>
-rwxr-xr-x | scripts/bk_tests/bk_container_prep.sh | 21 | ||||
-rwxr-xr-x | scripts/bk_tests/bk_install.sh | 9 | ||||
-rwxr-xr-x | scripts/bk_tests/bk_linux_exec.sh | 45 |
3 files changed, 66 insertions, 9 deletions
diff --git a/scripts/bk_tests/bk_container_prep.sh b/scripts/bk_tests/bk_container_prep.sh new file mode 100755 index 0000000000..bf4711ec39 --- /dev/null +++ b/scripts/bk_tests/bk_container_prep.sh @@ -0,0 +1,21 @@ +# This script gets a container ready to run our various tests in BuildKite + +# make sure we have the network tools in place for various network specs +if [ -f /etc/debian_version ]; then + apt-get update -y && apt-get install -y net-tools iproute2 + touch /etc/network/interfaces +elif [ -f /etc/redhat-release ]; then + yum install -y net-tools +fi + +# make sure we have the omnibus_overrides specified version of rubygems / bundler +gem update --system $(grep rubygems omnibus_overrides.rb | cut -d'"' -f2) +gem --version +gem uninstall bundler -a -x || true +gem install bundler -v $(grep :bundler omnibus_overrides.rb | cut -d'"' -f2) +bundle --version +rm -f .bundle/config + +# force all .rspec tests into progress display to reduce line count +echo --color > .rspec +echo -fp >> .rspec diff --git a/scripts/bk_tests/bk_install.sh b/scripts/bk_tests/bk_install.sh deleted file mode 100755 index de74af151c..0000000000 --- a/scripts/bk_tests/bk_install.sh +++ /dev/null @@ -1,9 +0,0 @@ -gem update --system $(grep rubygems omnibus_overrides.rb | cut -d'"' -f2) -gem --version -gem uninstall bundler -a -x || true -gem install bundler -v $(grep :bundler omnibus_overrides.rb | cut -d'"' -f2) -bundle --version -rm -f .bundle/config -# force all .rspec tests into progress display to reduce line count -echo --color > .rspec -echo -fp >> .rspec diff --git a/scripts/bk_tests/bk_linux_exec.sh b/scripts/bk_tests/bk_linux_exec.sh new file mode 100755 index 0000000000..fee73aa6bb --- /dev/null +++ b/scripts/bk_tests/bk_linux_exec.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# Enable IPv6 in docker +sudo systemctl stop docker +echo "Enabling IPv6 in Docker config" +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 + +# Verify Docker Is Running +docker version +sudo service docker status + +# Install C and C++ +sudo yum install -y gcc gcc-c++ openssl-devel readline-devel zlib-devel + +# Install omnibus-toolchain for git bundler and gem +curl -fsSL https://chef.io/chef/install.sh | sudo bash -s -- -P omnibus-toolchain + +# Set Environment Variables +export BUNDLE_GEMFILE=$PWD/kitchen-tests/Gemfile +export FORCE_FFI_YAJL=ext +export CHEF_LICENSE="accept-silent" +export PATH=$PATH:~/.asdf/shims:/opt/asdf/bin:/opt/asdf/shims:/opt/omnibus-toolchain/embedded/bin + +# Install ASDF software manager +echo "--- Installing ASDF software version manager from master" +sudo git clone https://github.com/asdf-vm/asdf.git /opt/asdf +. /opt/asdf/asdf.sh +. /opt/asdf/completions/asdf.bash + +echo "--- Installing Ruby ASDF plugin" +/opt/asdf/bin/asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby.git + +echo "--- Installing Ruby 2.5.5" +/opt/asdf/bin/asdf install ruby 2.5.5 +/opt/asdf/bin/asdf global ruby 2.5.5 + +# Update Gems +gem update --system $(grep rubygems omnibus_overrides.rb | cut -d'"' -f2) +gem install bundler -v $(grep :bundler omnibus_overrides.rb | cut -d'"' -f2) --force --no-document +sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER ) +ruby --version +which bundle +bundle install --jobs=3 --retry=3 --path=vendor/bundle
\ No newline at end of file |