2016-06-16 19:34:25 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2017-09-27 22:30:54 +00:00
|
|
|
# Linux helper functions:
|
|
|
|
function update_linux() {
|
|
|
|
sudo apt-get update -qq
|
2019-08-18 07:40:16 +00:00
|
|
|
sudo apt-get install -qq python3-apt python3-pycurl git python3-pip build-essential autoconf rpm
|
2017-09-27 22:30:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function install_ansible {
|
|
|
|
bash .ci/ansible-setup.sh
|
2018-04-16 16:23:19 +00:00
|
|
|
# pyOpen, ndg-* and pyasn1 are for 'InsecurePlatformWarning' error
|
2019-08-18 07:40:16 +00:00
|
|
|
~/.avm/v2.8/venv/bin/pip install netaddr ansible-lint pyOpenSSL ndg-httpsclient pyasn1
|
2017-09-27 22:30:54 +00:00
|
|
|
}
|
2016-06-16 19:34:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Mac:
|
|
|
|
if [[ "$GITSECRET_DIST" == "brew" ]]; then
|
2019-01-11 15:14:22 +00:00
|
|
|
brew update
|
|
|
|
|
2017-09-28 14:05:19 +00:00
|
|
|
gnupg_installed="$(brew list | grep -c "gnupg")"
|
|
|
|
[[ "$gnupg_installed" -ge 1 ]] || brew install gnupg
|
2017-09-28 16:29:24 +00:00
|
|
|
if [[ -f "/usr/local/bin/gpg1" ]]; then
|
|
|
|
ln -s /usr/local/bin/gpg1 /usr/local/bin/gpg
|
|
|
|
fi
|
2019-03-12 19:41:54 +00:00
|
|
|
brew install gawk shellcheck
|
2016-06-16 19:34:25 +00:00
|
|
|
fi
|
|
|
|
|
2019-03-09 23:49:45 +00:00
|
|
|
# Windows
|
|
|
|
if [[ "$GITSECRET_DIST" == "windows" ]]; then
|
|
|
|
choco install make shellcheck -y
|
|
|
|
fi
|
|
|
|
|
2017-09-27 22:30:54 +00:00
|
|
|
# Linux:
|
|
|
|
if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ -n "$KITCHEN_REGEXP" ]]; then
|
|
|
|
update_linux
|
|
|
|
install_ansible
|
2016-06-16 19:34:25 +00:00
|
|
|
fi
|