Here are Jenkins job templates recommended for setting up continuous integration over GitHub repositories containing Nuxeo Addons, Packages or Plugins.
The jobs are now organized within folders: you must not create a job at Jenkins root.
Nuxeo Addons
For setting CI over a common Nuxeo Addon with a Maven build:
- Ensure your code respects the Maven Coding Rules;
- Add your addon in the Addons POM or in the Optionals Addons POM;
Create a new Jenkins job and choose "Nuxeo Addon" template:
Name Name it addons_MODULE_NAME-BRANCH
(for instance: "addons_nuxeo-diff-master" for the "master" branch of "https://github.com/nuxeo/nuxeo-diff")Addon name This is the repository name on GitHub. For instance:nuxeo-diff
for https://github.com/nuxeo/nuxeo-diff.Branch name Branch to build (ie:master
or5.8
)JDK Nuxeo 7.2+ => Java 8 (
java-8-oracle
) Nuxeo 5.8, 6.0 => Java 7 (java-7-sun
orjava-7-openjdk
) Nuxeo 5.6 => Java 6 (java-6-sun
orjava-6-openjdk
)Maven version Nuxeo 6.0+ => Maven 3 (maven-3
) Nuxeo 5.8 => Maven 2.2.1 (maven-2.2.1
)Assigned node(s) or label(s) Default isSLAVE
Nuxeo Packages
For setting CI over a common Nuxeo Package with a Maven build:
- Ensure your code respects the Maven Coding Rules;
- Add your package in marketplace.ini;
Create a new Jenkins job and choose the "Nuxeo Package" template:
Name Name itaddons_FT_MODULE_NAME-BRANCH
(for instance:addons_FT_nuxeo-diff-master
for the master branch of https://github.com/nuxeo/marketplace-diff, MP of https://github.com/nuxeo/nuxeo-diff. Note MODULE_NAME=nuxeo-diff and not marketplace-diff).Nuxeo Package name This is the repository name on GitHub. For instance:marketplace-diff
for https://github.com/nuxeo/marketplace-diff.Branch name Branch to build (ie:master
or1.1
)Upstream addon being packaged For instance: "addons_nuxeo-diff-master" JDK Nuxeo 7.2+ => Java 8 (
java-8-oracle
) Nuxeo 5.8, 6.0 => Java 7 (java-7-sun
orjava-7-openjdk
) Nuxeo 5.6 => Java 6 (java-6-sun
orjava-6-openjdk
)Maven version Nuxeo 6.0+ => Maven 3 (maven-3
) Nuxeo 5.8 => Maven 2.2.1 (maven-2.2.1
)Maven profiles Defaults:-Pqa,ftest
Package(s) path Relative path(s) to the Nuxeo Package(s) for upload on Connect and Connect Test, starting from inside the cloned repository. Shell wildcards accepted. A list with space as separator is also accepted. Any string for whichls $path_to_mp
outputs the wanted packages. If empty, defaults tomarketplace/target/marketplace-*-SNAPSHOT.zip
.Files to archives Ant wildcards accepted. If empty, defaults to**/log/*.log, **/nxserver/config/distribution.properties, **/failsafe-reports/*, **/target/results/*.html, **/target/*.png, **/target/*.html
. The Nuxeo Package(s) configured above is (are) also archived.Log files Path to the files in which to search for errors. The console is always parsed. Common value is:ftest/**/log/server.log
Additional upstream jobsOther upstream jobs than the "Upstream addon being packaged". If empty, defaults tonuxeo-distribution-master
.Assigned node(s) or label(s) Default isSLAVE
Nuxeo Plugins
For setting CI over a standalone Nuxeo Plugin (Addon + Package hosted together in the same GitHub repository) with a Maven build:
- Ensure your code respects the Maven Coding Rules;
- Add your plugin in marketplace.ini;
Create a new Jenkins job and choose the "Nuxeo Plugin" template:
Name Name itplugins_MODULE_NAME-BRANCH-NXP_BRANCH
For instance:plugins_nuxeo-timeoff-master-master
for themaster
branch of "https://github.com/nuxeo/nuxeo-timeoff", building a plugin and its package based on themaster
branch of the Nuxeo Platform. For instance:plugins_nuxeo-timeoff-1.0-7.10
for the1.0
maintenance branch of "https://github.com/nuxeo/nuxeo-timeoff", building a plugin and its package based on the7.10
maintenance branch of the Nuxeo Platform.Plugin name This is the repository name on GitHub. For instance: "nuxeo-timeoff" for https://github.com/nuxeo/nuxeo-timeoff.Branch name Branch to build (ie: "master" or "1.1")JDK Nuxeo 7.2+ => Java 8 (
java-8-oracle
) Nuxeo 5.8, 6.0 => Java 7 (java-7-sun
orjava-7-openjdk
) Nuxeo 5.6 => Java 6 (java-6-sun
orjava-6-openjdk
)Maven version Nuxeo 6.0+ => Maven 3 (
maven-3
) Nuxeo 5.8 => Maven 2.2.1 (maven-2.2.1
)Maven profiles Defaults:-Pqa,marketplace,ftest
Package(s) path Relative path(s) to the Nuxeo Package(s) for upload on Connect and Connect Test, starting from inside the cloned repository. Shell wildcards accepted. A list with space as separator is also accepted. Any string for which "ls $path_to_mp" outputs the wanted packages. If empty, defaults tomarketplace/target/marketplace-*-SNAPSHOT.zip
.Files to archives Ant wildcards accepted. If empty, defaults to**/log/*.log, **/nxserver/config/distribution.properties, **/failsafe-reports/*, **/target/results/*.html, **/target/*.png, **/target/*.html
. The Nuxeo Package(s) configured above is (are) also archived.Deploy to Nexus Default:false
Log files Path to the files in which to search for errors. The console is always parsed. Common value is:ftest/**/log/server.log
Additional upstream jobsOther upstream jobs (for instancenuxeo-distribution-master
).Assigned node(s) or label(s) Default isSLAVE
Discard Old Build
properties([[$class: 'BuildDiscarderProperty',
strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '',
artifactNumToKeepStr: '1',
daysToKeepStr: '60',
numToKeepStr: '60']]])
About "Discard Old Build", the properties set in the job are lost when setting properties in the Jenkinsfile.
Abort the Build If It's Stuck + Add Timestamps to the Console Output
timestamps {
timeout(time: 240, unit: 'MINUTES') {
// code here
}
}