简体   繁体   English

CI。Jenkins权限在.sh文件中被拒绝

[英]CI Jenkins Permission denied on .sh file

I am running into an issue which I've been researching on for days. 我遇到了一个问题,我已经研究了好几天了。 Having given up, I've decided to ask here. 放弃了,我决定在这里问。

I am trying to fix a permission denied CI exception. 我正在尝试修复拒绝CI异常的权限。 The error below occurs when it is trying to run a .sh script. 尝试运行.sh脚本时会出现以下错误。

+ find . -name '*.sh' -type f -exec chmod +x '{}' ';'
+ scripts/run_ci.py --push-merge
/tmp/hudson1523957012397738349.sh: line 3: scripts/run_ci.py: Permission denied
Build step 'Execute shell' marked build as failure

I tried adding 'chmod' command inside CI's 'Execute Shell' but it didn't work. 我尝试在CI的'Execute Shell'中添加'chmod'命令,但它没有用。 Below is exactly how I've written it. 以下是我写的方式。

find . -name "*.sh" -exec chmod +x {} \;

In the error log however, the brackets and the semi-colon is executed with ' ' and backlash completely disappeared. 然而,在错误日志中,括号和分号用''执行,反冲完全消失。

Additional note: I have also tried adding "" in the command and still receives error such as this: 附加说明:我还尝试在命令中添加“”并仍然收到如下错误:

find . -name "*.sh" -exec chmod +x "{}" "\;" 

My question is: 我的问题是:

  1. Could it be the '' sign that failed the command? 这可能是指令失败的标志吗?

  2. If so, how do I ensure the '' is not added into the command? 如果是这样,我如何确保''没有添加到命令中?

  3. If not, how can I fix this permission issue for CI? 如果没有,我如何修复CI的此权限问题?

Comment: 评论:

I can't comment down there for some reason but I will upvote your comments later when I am able to but thank you for pointing that out that the .py doesn't get the permission changed and the list dir thing as well. 由于某种原因,我不能在那里发表评论,但是当我能够但我感谢你指出.py没有获得权限更改和列表目录的事情时,我会在以后提出你的意见。

I greatly appreciate it since I've been struggling with it for days now. 我非常感激,因为我已经挣扎了好几天了。 TT.TT TT.TT

The error says that the permissions on run_ci.py are wrong. 该错误表明run_ci.py上的权限是错误的。 Your find command only adds execute permission to .sh files, not .py files. 您的find命令仅为.sh文件添加执行权限,而不是.py文件。 – Barmar - 巴马尔

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

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