2017-11-08 17:27:52 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-02-18 23:01:07 +00:00
|
|
|
set -e
|
|
|
|
|
2017-11-08 17:27:52 +00:00
|
|
|
RED='\033[0;31m'
|
|
|
|
NC='\033[0m'
|
|
|
|
GREEN='\033[32m'
|
|
|
|
|
2019-02-18 23:01:07 +00:00
|
|
|
if [[ "$#" -ne 2 ]]; then
|
2017-11-08 17:27:52 +00:00
|
|
|
echo -e "${RED}You must provide the virtualenv directory and the Ansible version to use.${NC}"
|
|
|
|
echo -e "${RED}Usage: test_install.sh virtualenv_dir ansible_version. ${NC}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
VIRTUALENV_DIR=$1
|
|
|
|
ANSIBLE_VERSION=$2
|
|
|
|
|
|
|
|
virtualenv --clear ${VIRTUALENV_DIR}
|
|
|
|
|
|
|
|
source ${VIRTUALENV_DIR}/bin/activate
|
|
|
|
|
2017-11-16 14:49:00 +00:00
|
|
|
pip -V
|
|
|
|
|
2017-11-08 17:27:52 +00:00
|
|
|
package=dist/$(ls dist)
|
|
|
|
|
|
|
|
echo -e "${GREEN}Installing the packages ${package} and ansible ${ANSIBLE_VERSION} ${NC}"
|
|
|
|
|
2019-02-18 23:28:51 +00:00
|
|
|
pip install -q ${package} ansible==${ANSIBLE_VERSION}
|
2017-11-08 17:27:52 +00:00
|
|
|
|
2019-02-18 23:01:07 +00:00
|
|
|
${VIRTUALENV_DIR}/bin/ansible-playbook-grapher --version
|
2019-02-18 23:28:51 +00:00
|
|
|
${VIRTUALENV_DIR}/bin/ansible-playbook-grapher tests/fixtures/example.yml
|