Bootstrap

jenkins pipeline node parallel怎么写

jenkins pipeline脚本的写法分为声明式和脚本式,写法不太一样,两种都怎么写。
1、声明式

pipeline{
    agent{
        label "master"
    }
    stages{
        stage('parallel'){
            parallel {
                stage('windows') {
                    steps {
                        echo "windows"
                    }
                }
                stage('linux') {
                    steps {
                        echo "linux"
                    }
                }
            }
        }
    }
}

2、脚本式

node{
    stage('Parallel Stage') {
        parallel (
            'windows': {
                echo "windows"
            },
            'linux': {
                echo "linux"
            }
        )
    }
}
;