ℹ️ Unmaintained
This project is currently not maintained.
The PV pipeline library is an extension for the pipeline library and adds steps to standardize the maven build process in pro!vision projects.
💡 Is is absolutely recommended to read the wcm-io-devops Jenkins Pipeline Library documentation of the pipeline library.
The main concepts of the pv pipeline library are
- DRY
- Maintainability
- Configurability
It reduces the code a developer has to write to get the project build by Jenkins. It consolidates the characteristics of our projects but also provides a high level of configurability.
The requirements of our maven based project have a large congruence. A normal maven project has the following steps:
- Set job properties (like log rotation, no concurrent builds)
- Checkout code from SCM using GIT
- Remove existing project and dependency snapshots from local maven repository (e.g. from io.wcm)
- Build the maven project and deploy the artifacts to nexus
- Analyse the maven project (e.g. pmd, checkstyle, opentasks, findbugs)
- Publish reports (e.g. JUnit, pmd, checkstyle, opentasks, spotbugs etc.)
- Notify the teams when a job status changes (e.g. failure, unstable, fixed)
To avoid that each project has redundant pipeline code doing these steps this library introduces the buildDefault
Building a feature branch is the same as the default maven build with two exceptions:
- The branch is merged with master before build
- The artifacts are not deployed to nexus (so no
mvn clean deploy
)
The buildFeature step automatically takes care of this.
The routeDefaultJenkinsFile the main part for DRY. This step automatically detects if the current pipeline build is a "normal" pipeline build or a multi branch pipeline build.
With this step it is possible to place one Jenkinsfile
in you project
root which looks like this:
@Library('pipeline-library') pipelineLibrary
@Library('pv-pipeline-library') pvPipelineLibrary
routeDefaultJenkinsFile()
Even when the pv pipeline library streamlines the jenkins build it provides a large amount of configuration options to ensure that project specific needs are covered.
💡 Have a look at Configuration for more information.
💡 It is also recommended to read the config structure documentation from pipeline library.
You can extend the pipelines / steps by providing custom callbacks/closures at specific points.
💡 Have a look at Extension options for more information.
The big part of our projects is using JDK and Apache Maven 3. So the initialization of these tools was moved to the step setupPVTools to make this easier.
In order to use the pv pipeline library you have to fulfil these requirements:
- jenkins-pv-pipeline-library requirements
- jenkins-pipeline-library requirements
The PV pipeline library provides the following steps:
buildDefault
buildFeature
defaultAnalyzeStage
defaultBuildWrapper
defaultCompileStage
defaultPreparationStage
defaultResultsStage
featurePreparationStage
getDefaultMavenDefines
routeDefaultJenkinsFile
setDefaultJobProperties
setupPVTools
The PV pipeline library provides the following utilities:
located here: docs/tutorials.
The most important tutorials:
- Tutorial: Setup a project folder
- Tutorial: Setup a project for
- Tutorial: Setup a feature branch build job
General documentation is in the docs folder.
Please have a look at the Configuration documentation for config options and configuration examples.
The library uses two approaches for testing.
The class parts are tested by unit testing using JUnit/Surefire. All
unit tests have the naming format *Test.groovy
and are located below
test/io
.
The step parts are tested by using
Jenkins Pipeline Unit
with jUnit/Failsafe. All integration tests have the naming format
*IT.groovy
and are located below test/vars
.
mvn clean install
mvn license:update-file-header