Link to home
Start Free TrialLog in
Avatar of BharathKumarRaju DasaraRaju
BharathKumarRaju DasaraRajuFlag for India

asked on

help me understand the shell script

help me to understand the below lines in below shell script..

Why we need to use virtualenv "$ANSIBLE_ROOT" .... and what is the use of virtualenv here ....

and how activate and deactivate worked ...i am bit confused how activate and deactivate keywords worked here..
. "$ANSIBLE_ROOT/bin/activate"
deactivate


and also how pip works with -i option...i.e. below

pip install docker-compose==1.15.0 -i https://artifactory.global.raju.com/artifactory/api/pypi/pypi-release/simple


#!/usr/bin/env sh

ANSIBLE_ROOT=${ANSIBLE_ROOT:-~/ansible}
scl enable python27 bash <<!
set -e
export https_proxy=https://10.198.140.122:8080
if [ ! -d "$ANSIBLE_ROOT/bin" ]
then
    virtualenv "$ANSIBLE_ROOT"
    . "$ANSIBLE_ROOT/bin/activate"
    echo "Installing latest version of ansible"
    pip install ansible -i https://artifactory.global.raju.com/artif4actory/api/pypi/pypi-release/simple
    pip install docker-py -i https://artifactory.global.raju.com/artifactory/api/pypi/pypi-release/simple
    pip install docker-compose==1.15.0 -i https://artifactory.global.raju.com/artifactory/api/pypi/pypi-release/simple
    deactivate
fi
!

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Swadhin Ray
Swadhin Ray
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BharathKumarRaju DasaraRaju

ASKER

Thank you