我是jenkins的新手,正在尝试编写管道。作业运行时一切正常,但面临管道问题。我的脚本从github签出后应该运行,返回的文件未找到。任何人都可以帮忙。附件是日志的图像。 https://i.stack.imgur.com/LuxGn.png 下面是我尝试执行的代码示例。
stage('puppet master config checkout') {
steps {
echo "cloning github"
git "https://github.com/rk280392/pipeline_scripts.git"
}
}
stage('puppet master config build') {
steps {
echo "running puppet master script"
sh "puppet_master.sh"
}
}
答案 0 :(得分:0)
checkout([
$class: 'GitSCM',
branches: scm.branches,
extensions: scm.extensions,
userRemoteConfigs: [[
url: 'https://github.com/rk280392/pipeline_scripts.git'
]]
])
chmod +x puppet_master.sh
运行它之前使用./puppet_master.sh
sh 'sh puppet_master.sh'