简体   繁体   English

在linux中改变jenkins的工作空间

[英]changing workspace of jenkins in linux

I've installed Jenkins on Linux, and I'm new to both. 我已经在Linux上安装了Jenkins,而且我对两者都很陌生。 I configured a job with a custom workspace /root/xxxx (directory structure already in place). 我使用自定义工作区/ root / xxxx配置了一个作业(目录结构已经到位)。 It gives me the following error: 它给了我以下错误:

Building in workspace /root/bhanu
java.io.IOException: Failed to mkdirs: /root/bhanu
at hudson.FilePath.mkdirs(FilePath.java:847)

Another question: when executing copy command in Execute Shell build step it gives me 'permission denied' error. 另一个问题:在Execute Shell构建步骤中执行复制命令时,它会给出“权限被拒绝”错误。 From the console output the copy command works fine. 从控制台输出复制命令工作正常。 Here is the error: 这是错误:

+ cp /home/user1/victor.war /root/apache-tomcat-6.0.29/webapps/
cp: accessing '/root/apache-tomcat-6.0.29/webapps/': Permission denied

When I try to set permissions in shell script in Jenkins it gives me 'permission denied' error: 当我尝试在Jenkins的shell脚本中设置权限时,它会给我“权限被拒绝”错误:

+ chmod a+rwx /root/apache-tomcat-6.0.29/webapps/
chmod: cannot access '/root/apache-tomcat-6.0.29/webapps/': Permission denied

Try 尝试

ps aux |grep jenkins

to see what user the process has. 查看该进程的用户。 On Linux, jenkins uses the JENKINS_USER variable to define what user it should run as. 在Linux上,jenkins使用JENKINS_USER变量来定义应该运行的用户。 For a standard Ubuntu package install, the config file in /etc/default/jenkins specifies the user in the JENKINS_USER variable. 对于标准的Ubuntu软件包安装, /etc/default/jenkins的配置文件指定JENKINS_USER变量中的用户。

In the same config file, you can also specify the default workspace location using JENKINS_HOME . 在同一个配置文件中,您还可以使用JENKINS_HOME指定默认工作空间位置。 Make sure that is owned by the user you specified in JENKINS_USER to have Jenkins access files. 确保您在JENKINS_USER指定的用户拥有Jenkins访问文件。

For slave nodes, specify the default workspace on the slave machine in the slave configuration under Manage Jenkins > Manage Nodes > > Configure > Remote FS root. 对于从属节点,在“管理Jenkins”>“管理节点”>“配置”>“远程FS根”下的从属配置中指定从属计算机上的默认工作空间。 Again, this should have read/write/execute permissions for the JENKINS_USER user. 同样,这应该具有JENKINS_USER用户的读/写/执行权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM