Jenkins Pipelines Summary

示例1:

pipeline{
    agent {label "xxx"} // label is a special machine registered in Jenkins
    environment{
        CLONE_TRAINER_TEST_CMD = '''
        cd $wksp  // shell command
    '''

    START_TRAINER_TEST_CLIENT_CMD = '''
        // shell command
    '''
    }
    stages{
        stage("xxx"){   // can define by yourself, it will display in the beginning of Jenkins output log
            parallel{
                stage("xxx"){  // define task scenaria, such as 'build'
                    agent {label "xxx"}  // a special machine
                    steps{
                        sh env.CLONE_TRAINER_TEST_CMD
                        sh '''
                            cd $wksp // shell command
                           '''
                    }
                }
                
                stage("xxx"){
                    agent {label "xxx"}
                    steps{
                        // shell command
                    }
                }
            }
        }
    }
}

 

posted @ 2019-03-19 23:42  开心大人  阅读(300)  评论(0编辑  收藏  举报