权限被拒绝错误 - jenkins(shell脚本) [英] Permission denied error - jenkins (shell script)

查看:56
本文介绍了权限被拒绝错误 - jenkins(shell脚本)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jenkinsfile 来测试我们的一个实例.为此,我创建了一个 bash 脚本.问题是詹金斯没有运行脚本的权限.知道如何解决这个问题吗?

I'm using a jenkinsfile to test one of our instances. For this I created a bash script. Problem is that jenkins doesn't have permissions to run the script. Any idea how to fix this?

Jenkins 文件:

Jenkinsfile:

 stage("Testing instances"){
    if (terragruntAction == 'apply' || terragruntAction == 'test'){
       echo "Testing"
       sh '../check_services.sh'
    }
 }

输出:

../check_services.sh:权限被拒绝

../check_services.sh: Permission denied

我尝试过:

git update-index --chmod=+x check_services.sh 

在 Jenkins 签出但没有运气的 git 文件夹上.

on the git folder that gets checkouted by Jenkins but no luck.

任何帮助,在此先感谢!

Any help, thanks in advance!

推荐答案

我把它添加到 GIT repo 中:git update-index --chmod=+x check_services.sh

I got it working with adding this to the GIT repo: git update-index --chmod=+x check_services.sh

这篇关于权限被拒绝错误 - jenkins(shell脚本)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆