我正在使用Jenkinsfile来测试我们的一个实例。
为此,我创建了一个Bash脚本。
问题是Jenkins没有权限运行该脚本。你有什么解决办法吗?
Jenkinsfile:
输出: ../check_services.sh:拒绝访问
我尝试做:
在 Jenkins 检出的 Git 文件夹上尝试了,但没有成功。有任何帮助,谢谢!
Jenkinsfile:
stage("Testing instances"){
if (terragruntAction == 'apply' || terragruntAction == 'test'){
echo "Testing"
sh '../check_services.sh'
}
}
输出: ../check_services.sh:拒绝访问
我尝试做:
git update-index --chmod=+x check_services.sh
在 Jenkins 检出的 Git 文件夹上尝试了,但没有成功。有任何帮助,谢谢!
#!/bin/bash
作为进程解释器?如果你已经使用 (chmod 0755 filename
) 命令将其赋予自己或所属组可执行权限,那么它可能会出现无法确定正确解释器的问题。 - David C. Rankinsh check_services.sh
需要读取权限,而不是执行权限。 - Yaroslav Surzhikov