I am trying to run a custom Python module located at
sys.path.insert(0,'/home/modules') """also /home/modules/"""
ImportError: No module named
root@dwh-01:~$ usermod -m -d /home/jenkins jenkins
bash: cd: jenkins/: No such file or directory
Starting Jenkins Continuous Integration Server jenkins
No directory, logging in with HOME=/
usermod -d /home/jenkins jenkins
Ok finally figured it out.
What I did was change in the
/etc/default/jenkins file the variable JENKINS_USER and JENKINS_GROUP to the user i needed to outside of the jenkins user folder (outside of
This way the scripts ran by Jenkins will be ran as if it was the selected user I specified.
After that, I realized that in Jenkins, even if the working directory is
/var/lib/jenkins/jobs/adjust_data_parser/workspace, scripts and files can be called from '/'
So the trick was:
-Accessing the script outside of the jenkins home directory
-Importing the module from its absolute path.