win*_*.sm 8 jenkins jenkins-pipeline
我想在管道中隐藏jenkins sh execute命令
pipeline {
agent any
stages {
stage('Load Lib') {
steps {
sh "ls -al /"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
当前结果:
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Load Lib)
[Pipeline] sh
[Test] Running shell script
+ ls -al /
Run Code Online (Sandbox Code Playgroud)
我想在输出中隐藏Running shell脚本ls -al /命令。
请帮忙
这绝对与Jenkins控制台输出中的回显有关
对于管道,这意味着:
pipeline {
agent any
stages {
stage('Load Lib') {
steps {
sh '''
set +x
s -al
set -x
'''
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
'''表示多行命令。set +x关闭命令回显,然后set -x再次打开。
| 归档时间: |
|
| 查看次数: |
10210 次 |
| 最近记录: |