Run a local Jenkins:
docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts
Jenkins doesn't come with the necessary plugins OOTB, there's one that needs to be installed, look it up in MPL's README.
Once that's done, add both MPL (general framework) and the
test-mpl-nested-library (for Magnolia specifics) as shared libraries.
Override a step
Build.groovy is overriden in the
override branch of the
test-mpl-project by using the following path:
Run Maven/JS projects with the same pipeline
js branch of the
test-mpl-project will run a Node build thanks to the logic in: https://github.com/magnolia-cms/test-mpl-nested-library/blob/master/resources/info/magnolia/jenkins/modules/Build/Build.groovy
The advantage when all builds run the same pipeline (rather than a couple of templates as we do it currently) is that:
- setup steps (such as downloading the build scripts, mounting the AWS volume),
- and even 'business logic' (JIRA health check, binary compatibility, etc.)
do not need to be copy-pasted, but can simply be turned on/off on demand.
Examples of customization (non-exhaustive list)
Disable steps from the project pipeline:
Tweak steps thanks to MPL configuration (not my example):
The framework comes with helper methods and examples that allow to easily write tests like the following: https://github.com/magnolia-cms/test-mpl-nested-library/blob/master/test/groovy/info/magnolia/jenkins/modules/Build/BuildTest.groovy
This is a big advantage over our current implementation where we have no visibility once we push changes.