我想在管道中隐藏jenkins sh execute命令
pipeline {
agent any
stages {
stage('Load Lib') {
steps {
sh "ls -al /"
}
}
}
}
当前结果:
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Load Lib)
[Pipeline] sh
[Test] Running shell script
+ ls -al /
我想在输出中隐藏Running shell脚本ls -al /命令。
请帮忙
最佳答案
这肯定与Echo off in Jenkins Console Output有关
对于管道,这意味着:
pipeline {
agent any
stages {
stage('Load Lib') {
steps {
sh '''
set +x
s -al
set -x
'''
}
}
}
}
'''
表示多行命令。 set +x
关闭命令回显,然后set -x
重新打开它。
关于jenkins - 隐藏命令已执行,仅显示输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47523909/