ansible-role-mongodb/tests/scripts/before_install.sh

33 lines
803 B
Bash
Raw Normal View History

2018-02-15 06:30:38 +00:00
#!/usr/bin/env bash
# -*- mode: sh; -*-
# File: before_install.sh
# Time-stamp: <2018-07-12 18:05:37>
2018-02-15 06:30:38 +00:00
# Copyright (C) 2018 Sergei Antipov
# Description:
# set -o xtrace
set -o nounset
set -o errexit
set -o pipefail
2018-02-15 07:04:29 +00:00
# Latest Ansible install
pip install docker ansible mitogen
cat << EOF > ansible.cfg
[defaults]
pipelining = True
strategy = mitogen_linear
strategy_plugins = /home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/ansible_mitogen/plugins/strategy
EOF
2018-02-15 08:54:10 +00:00
2018-02-15 06:30:38 +00:00
# Pull docker image or build it
if [ -f tests/Dockerfile.${DISTRIBUTION}_${DIST_VERSION} ]
then
2018-02-15 08:14:06 +00:00
docker build --rm=true --file=tests/Dockerfile.${DISTRIBUTION}_${DIST_VERSION} --tag ${DISTRIBUTION}:${DIST_VERSION} tests
2018-02-15 06:30:38 +00:00
else
2018-02-15 08:14:06 +00:00
docker pull ${DISTRIBUTION}:${DIST_VERSION}
2018-02-15 06:30:38 +00:00
fi
2018-02-15 07:26:38 +00:00
ln -s ${PWD} tests/greendayonfire.mongodb