【发布时间】:2017-02-14 23:00:30
【问题描述】:
我正在使用 Jenkinsfile 编写管道脚本。
有什么方法可以禁止在构建日志中打印已执行的 shell 命令?
这里只是一个简单的 jenkins 管道示例:
node{
stage ("Example") {
sh('echo shellscript.sh arg1 arg2')
sh('echo shellscript.sh arg3 arg4')
}
}
在控制台日志中产生以下输出:
[Pipeline] node
Running on master in /var/lib/jenkins/workspace/testpipeline
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Test)
[Pipeline] sh
[testpipeline] Running shell script
+ echo shellscript.sh arg1 arg2
shellscript.sh arg1 arg2
[Pipeline] sh
[testpipeline] Running shell script
+ echo shellscript.sh arg3 arg4
shellscript.sh arg3 arg4
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
基本上我想禁用命令本身的打印。
+ echo shellscript.sh arg1 arg2
+ echo shellscript.sh arg3 arg4
【问题讨论】:
标签: jenkins jenkins-pipeline jenkinsfile