Command not found in Execute Shell build step

4,554 views
Skip to first unread message

morty

unread,
Apr 13, 2016, 4:17:56 AM4/13/16
to Jenkins Users
I have installed Jenkins on Ubuntu 15.10. In a Jenkins job I have a single Execute Shell step with:

virtualenv --no-site-packages virtual_django
cd virtual_django
/bin
pwd
dir
source activate

When I run the job I get:


+ virtualenv --no-site-packages virtual_django
New python executable in virtual_django/bin/python2
Also creating executable in virtual_django/bin/python
Installing setuptools, pip...done.
Running virtualenv with interpreter /usr/bin/python2
+ cd virtual_django/bin
+ pwd
/var/lib/jenkins/workspace/django-demo/virtual_django/bin
+ dir
activate      activate.fish easy_install      pip   pip2.7  python2
activate.csh  activate_this.py  easy_install-2.7  pip2  python  python2.7
+ source activate
/tmp/hudson4515625893361069094.sh: 9: /tmp/hudson4515625893361069094.sh: source: not found
Build step 'Execute shell' marked build as failure



So in the Jenkins job the source command is not found. It works fine from a terminal where I have logged in as the jenkins user. 

Why can't the above script find the source command when run inside the Jenkins job?

thomas....@teamaol.com

unread,
Apr 13, 2016, 5:25:29 AM4/13/16
to Jenkins Users

morty

unread,
Apr 13, 2016, 6:12:29 AM4/13/16
to Jenkins Users
Thanks that fixed the problem.
Reply all
Reply to author
Forward
0 new messages