mirror of
https://github.com/haidaraM/ansible-playbook-grapher
synced 2024-11-12 23:17:07 +00:00
28 lines
656 B
Bash
28 lines
656 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
RED='\033[0;31m'
|
||
|
NC='\033[0m'
|
||
|
GREEN='\033[32m'
|
||
|
|
||
|
if [ "$#" -ne 2 ]; then
|
||
|
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
|
||
|
|
||
|
package=dist/$(ls dist)
|
||
|
|
||
|
echo -e "${GREEN}Installing the packages ${package} and ansible ${ANSIBLE_VERSION} ${NC}"
|
||
|
|
||
|
pip install -q ${package} ansible==${ANSIBLE_VERSION}
|
||
|
|
||
|
ansible-playbook-grapher --version
|
||
|
|
||
|
ansible-playbook-grapher examples/example.yml
|