How to install packages using pip in jenkins -
i have created job in jenkins , trying build project.
my shell command:
#!/bin/bash source env/bin/activate cd petinstantapi pip install -r requirements.txt python manage.py migrate python manage.py test
my console output says it's failed when installing packages in requirements file.
oserror: [errno 13] permission denied: '/usr/local/lib/python2.7/dist-packages/django-1.8.dist-info'
i have tried using
sudo pip install -r requirements.txt
but no luck.
by default, sudo
prompts password. basically, have 2 options of solving that:
- running jenkins root, not you'd do, or
allowing user jenkins runs under execute
pip
without password. add following line end of/etc/sudoers
file (make sure usesudo visudo
editing that):jenkins_user all=nopasswd:/usr/bin/pip
Comments
Post a Comment