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-difffor https://github.com/nuxeo/nuxeo-diff.Branch name Branch to build (ie:masteror5.8)JDK Nuxeo 7.2+ => Java 8 (
java-8-oracle) Nuxeo 5.8, 6.0 => Java 7 (java-7-sunorjava-7-openjdk) Nuxeo 5.6 => Java 6 (java-6-sunorjava-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-masterfor 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-difffor https://github.com/nuxeo/marketplace-diff.Branch name Branch to build (ie:masteror1.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-sunorjava-7-openjdk) Nuxeo 5.6 => Java 6 (java-6-sunorjava-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,ftestPackage(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_mpoutputs 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.logAdditional 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_BRANCHFor instance:plugins_nuxeo-timeoff-master-masterfor themasterbranch of "https://github.com/nuxeo/nuxeo-timeoff", building a plugin and its package based on themasterbranch of the Nuxeo Platform. For instance:plugins_nuxeo-timeoff-1.0-7.10for the1.0maintenance branch of "https://github.com/nuxeo/nuxeo-timeoff", building a plugin and its package based on the7.10maintenance 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-sunorjava-7-openjdk) Nuxeo 5.6 => Java 6 (java-6-sunorjava-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,ftestPackage(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:falseLog files Path to the files in which to search for errors. The console is always parsed. Common value is:ftest/**/log/server.logAdditional 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
}
}