Code Monkey home page Code Monkey logo

pipeline-dependency-walker-plugin's Introduction

Dependency Walker Plugin

Licensed under [MIT Licence].

About

Allows you to perform given pipeline step(s) on a job and all its linked jobs.

Linked jobs are the upstreams of the job, derived from maven dependencies. Dependency graph can be visualized using Dependency Graph View Plugin.

Usage scenarios

Clean build

The plugin can be used to preform a clean build in the isolated environment for the group of dependent projects.

Example of pipeline configuration:

node {
    stage('build') {
        echo "cleanup workspace"
        deleteDir()

        mvnRepo=pwd() + "/m2" // set local maven repo
        echo "use maven repo $mvnRepo"

        walk job: 'parent-project', jobAction: '''
            dir(JOB_NAME) {
                git url: JOB_SCM_URL, branch: JOB_SCM_BRANCH, credentialsId: JOB_SCM_CREDINTIALS_ID
                withMaven(maven: 'mvn', mavenLocalRepo: mvnRepo) {
                    sh "mvn clean install"
                }
            }
        '''
    }
}

Multiple release

Another use case is a multiple release. When the release action (see Release Plugin or M2 Release Plugin) is defined in a way that it drops SNAPSHOT keyword from dependencies, than using this plugin one can trigger a consistent release of multiple modules. In this scenario release should first update dependencies, for example invoking following maven target: versions:use-releases scm:checkin -Dmessage="drop snapshot versions"

In some way the plugin is an alternative to Maven Cascade Release Plugin.

Example of pipeline configuration:

node {
    stage('build') {
        walk job: 'parent-project', failOnUnstable: true, jobAction: 'release JOB_NAME'
    }
}

How to develop

First run a development instance of jenkins by executing a command mvn hpi:run

Go to jenkins development instance and configure as following:

  1. In system configuration click on Maven installations... button and configure:
  • Set Name to mvn
  • deselectInstall automatically
  • set MAVEN_HOME to your local maven installation (e.g. /usr/share/maven)
  1. In plugin manager install following plugins with restart:

pipeline-dependency-walker-plugin's People

Contributors

estarter avatar jsoref avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

jsoref swathi444

pipeline-dependency-walker-plugin's Issues

failOnUnstable: check last build status

introduce an option to check last build status of all related jobs before executing generated pipeline.
if the failOnUnstable is true that the step should fail and should not execute generated pipeline

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.