I have acreated a simple jenkins project and on build section, I use a shel bash script (execute shell) as follow:
cd /home/ubuntu
git clone https://github.com/Bazarganigilani/AppEngineCron.git
mvn clean install
However , when I built my project I face
+ cd /home/ubuntu
+ git clone https://github.com/Bazarganigilani/AppEngineCron.git
fatal: could not create work tree dir 'AppEngineCron': Permission denied
Build step 'Execute shell' marked build as failure
Finished: FAILURE
When I ssh to the node having this jenkins I can git clone in my /home/ubuntu directory but not through jenkins?
Is there a better way to avoid clone and make my jar somewhere in the jenkins node?
Seems like Jenkins is running with different user (other than UBUNTU). Mostly Jenkins will run with Jenkins user. So Jenkins user may not have permissions to create directory in /home/ubuntu.
Possible Solution: give /home/ubuntu folder access to the user which is running Jenkins
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.