Hide command executed, only show output

后端 未结 2 1868
野的像风
野的像风 2020-12-16 14:52

I want to hide jenkins sh execute command in pipeline

pipeline {
    agent any

    stages {
        stage(\'Load Lib\') {
            steps {
                       


        
相关标签:
2条回答
  • 2020-12-16 15:50

    This is definitely related to Echo off in Jenkins Console Output

    For pipeline, what this means is:

    pipeline {
        agent any
    
        stages {
            stage('Load Lib') {
                steps {
                    sh '''
                        set +x
                        s -al
                        set -x 
                    '''
                }
            }
        }
    }
    

    ''' indicates a multi line command. set +x turns off command echoing, and set -x turns it back on again.

    0 讨论(0)
  • 2020-12-16 15:50

    You can override this behaviour for the whole script by putting the following at the top of the build step:

    #!/bin/bash +x
    
    0 讨论(0)
提交回复
热议问题