0

I had created the AWS ubuntu server and installed Jenkins and tomcat servers on the same server where I had created Jenkins jobs by configuring cloning code from GitHub and installing maven for build process and have created the built step by using a shell command to copy war file from Jenkins home directory to the tomcat working directory(web apps) but I am getting an error

[gamutaguru] $ /bin/sh -xe /tmp/jenkins8325847671040322132.sh
+ cp /target/gamutgurus.war /root/apache-tomcat-10.0.27/webapps
cp: failed to access '/root/apache-tomcat-10.0.27/webapps': Permission denied
Build step 'Execute shell' marked build as failure
Finished: FAILURE

[Configure PicError Pic ](https://i.stack.imgur.com/9trYm.png)

  • You seem to be already authenticated as root. However, the copy command doesn't create the whole destination path by default. If some folder in the destination path doesn't exist, create the whole folderpath first through the command `mkdir /root/apache-tomcat-10.0.27/webapps --parents` – Davide Calarco Nov 17 '22 at 13:51
  • I had tried the same but getting the same issue – Bharath kumar Nov 18 '22 at 06:08
  • Try running the bash script with sudo: `sudo /bin/sh -xe /tmp/jenkins8325847671040322132.sh` – Davide Calarco Nov 18 '22 at 11:45

0 Answers0