I have a local jenkinsserver thats running on http://localhost:8080 in my personal MAC machine.
Now, I have created a sample Jenkinsfile and trying to run through Jenkins job.
stage ('Install_Requirements') {
steps {
sh """
echo ${SHELL}
[ -d venv ] && rm -rf venv
#virtualenv --python=python2.7 venv
virtualenv venv
#. venv/bin/activate
export PATH=${VIRTUAL_ENV}/bin:${PATH}
pip install --upgrade pip
pip install -r requirements.txt -r dev-requirements.txt
make clean
"""
}
}
There are multiple stages in the projects but when I execute this 'Install_Requirements' stage I get a error :-
[python-jenkinsfile-testing] Running shell script
+ echo /bin/bash
/bin/bash
+ '[' -d venv ']'
+ virtualenv venv
/Users/Shared/Jenkins/Home/workspace/python-jenkinsfile-testing@tmp/durable-4363725f/script.sh: line 6: virtualenv: command not found
When I try to execute virtualenv venv command on my terminal it creates the venv and I'm also able to activate the environment.
Not sure why I get this error.