Scripted jenkinsfile parallel stage

后端 未结 6 1623
星月不相逢
星月不相逢 2020-12-07 19:26

I am attempting to write a scripted Jenkinsfile using the groovy DSL which will have parallel steps within a set of stages.

Here is my jenkinsfile:

n         


        
6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-07 19:59

    I was also trying similar sort of steps to execute parallel stages and display all of them in a stage view. You should write a stage inside a parallel step as shown in the following code block.

    // Jenkinsfile (Scripted Pipeline)
    
    stage('Build') {
        /* .. Your code/scripts .. */
    }
    
    stage('Test') {
        parallel 'linux': {
            stage('Linux') {
                /* .. Your code/scripts .. */
            }
        }, 'windows': {
            stage('Windows') {
                /* .. Your code/scripts .. */
            }
        }
    }
    

提交回复
热议问题