git-secret/.ci/before_script.sh
Josh Rabinowitz 711a6889c3
travis-ci changes: remove ansible v2.3, fix brew build issue
* remove ansible avm v2.3 pip install
* work around perlbrew/build issue #305 with 'brew update' before installs
2019-01-11 10:14:22 -05:00

35 lines
836 B
Bash

#!/usr/bin/env bash
set -e
# Linux helper functions:
function update_linux() {
sudo apt-get update -qq
sudo apt-get install -qq python-apt python-pycurl git python-pip build-essential autoconf rpm
}
function install_ansible {
bash .ci/ansible-setup.sh
# pyOpen, ndg-* and pyasn1 are for 'InsecurePlatformWarning' error
~/.avm/v2.5/venv/bin/pip install netaddr ansible-lint pyOpenSSL ndg-httpsclient pyasn1
}
# Mac:
if [[ "$GITSECRET_DIST" == "brew" ]]; then
brew update
gnupg_installed="$(brew list | grep -c "gnupg")"
[[ "$gnupg_installed" -ge 1 ]] || brew install gnupg
if [[ -f "/usr/local/bin/gpg1" ]]; then
ln -s /usr/local/bin/gpg1 /usr/local/bin/gpg
fi
brew install gawk
fi
# Linux:
if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ -n "$KITCHEN_REGEXP" ]]; then
update_linux
install_ansible
fi