简体   繁体   中英

Visualize Jenkins pipeline or multibranch pipeline jobs

  • I have one Pipeline job for each component in my Jenkins 2.0. All of them consist of many stages (build, UT, IT etc.), so they're working as a pipeline for a component.
  • The components are depending on each other in a specified order, so I used "Build after other projects are built" (I also tried JobFanIn Plugin ) to trigger these "mini-pipelines" after each other. This works like a pipeline of "mini pipelines"

I'd like to visualize the relationship between the jobs. For this purpose I've found 2 plugins:

Both introduce a new View type, but none of them supports the "Pipeline" or "Multibranch pipeline" job types ( introduced in Jenkins 2.0 ), these jobs are not visible in the related dropdown list on the view config page.

How can I visualize the relation of these job types? Is there any other plugin which supports these types?

Thinking about this.

I don't think a visualisation of multi branch pipelines makes sense in the same way it would for a single branch build. The reason is that each bench of a mb pipeline can have a different build configuration. Eg with master triggering a promotion job but branch doing something else or nothing.

Do the best one could do I think is trace an individual build number and it's links. Can't do it at the job level.

Jenkins blue ocean plugins give the rich view to visualize all types (parallel, sequential stages) view out of the box.

Let say if you have a pipeline like this

pipeline {
    agent any;
    stages {
        stage('build') {
            stages {
                stage('compile') {
                    steps {
                        echo "steps for unitest"
                    }
                }
                stage('security scan') {
                    parallel {
                        stage('sonarqube') {
                            steps {
                                echo "steps for parallel sonarqube"
                            }
                        }
                        stage('blackduck') {
                            steps {
                                echo "steps for parallel blackduck"
                            }
                        }
                    }
                }
                stage('package') {
                    steps {
                        echo "steps for package"
                    }
                }
            }
        }
        stage('deployment') {
            stages {
                stage('dev') {
                    steps {
                        echo "Development"
                    }
                }
                stage('pp') {
                    when { branch 'master' }
                    steps {
                        echo "PreProduction"
                    }
                }
                stage('prod') {
                    when { 
                        branch 'master' 
                        beforeInput true
                    }
                    input {
                        message "Deploy to production?"
                        id "simple-input"
                    }
                    steps {
                        echo "Production"
                    }
                }
            }
        }
    }
}

It will visualize like this :

在此处输入图片说明

is this what you are looking for? Note- it can customize. but this view is per build ..you can't create a dashboard from it and combine it all in one

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM