Nuxeo Core Developer Guide

Jenkins Job Configuration

Updated: October 31, 2018 Page Information Edit on GitHub

Here are Jenkins job templates recommended for setting up continuous integration over GitHub repositories containing Nuxeo Addons, Packages or Plugins.

If your project is public and depends on a Studio project, you must add "jenkins_pub" as a contributor in the Studio settings.

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:

  1. Ensure your code respects the Maven Coding Rules;
  2. Add your addon in the Addons POM or in the Optionals Addons POM;
  3. 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 or 5.8)

    JDK

    Nuxeo 7.2+ => Java 8 (java-8-oracle) Nuxeo 5.8, 6.0 => Java 7 (java-7-sun or java-7-openjdk) Nuxeo 5.6 => Java 6 (java-6-sun or java-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 is SLAVE

Nuxeo Packages

For setting CI over a common Nuxeo Package with a Maven build:

  1. Ensure your code respects the Maven Coding Rules;
  2. Add your package in marketplace.ini;
  3. Create a new Jenkins job and choose the "Nuxeo Package" template:

    Name
    Name it addons_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 or 1.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 or java-7-openjdk) Nuxeo 5.6 => Java 6 (java-6-sun or java-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 which ls $path_to_mp outputs the wanted packages. If empty, defaults to marketplace/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 jobs

    Other upstream jobs than the "Upstream addon being packaged". If empty, defaults to nuxeo-distribution-master.

    Assigned node(s) or label(s)

    Default is SLAVE

Nuxeo Plugins

For setting CI over a standalone Nuxeo Plugin (Addon + Package hosted together in the same GitHub repository) with a Maven build:

  1. Ensure your code respects the Maven Coding Rules;
  2. Add your plugin in marketplace.ini;
  3. Create a new Jenkins job and choose the "Nuxeo Plugin" template:

    Name
    Name it plugins_MODULE_NAME-BRANCH-NXP_BRANCH For instance: plugins_nuxeo-timeoff-master-master for the master branch of "https://github.com/nuxeo/nuxeo-timeoff", building a plugin and its package based on the master branch of the Nuxeo Platform. For instance: plugins_nuxeo-timeoff-1.0-7.10 for the 1.0 maintenance branch of "https://github.com/nuxeo/nuxeo-timeoff", building a plugin and its package based on the 7.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 or java-7-openjdk) Nuxeo 5.6 => Java 6 (java-6-sun or java-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 to marketplace/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 jobs

    Other upstream jobs (for instance nuxeo-distribution-master).

    Assigned node(s) or label(s)

    Default is SLAVE

 

Sandbox Prototypes

 

Build Environment

Discard Old Build

JenkinsFile

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

Jenkinsfile

timestamps {
        timeout(time: 240, unit: 'MINUTES') {
                   // code here
                }
           }

a month ago manonlumeau Fix plugin CI requirement
2 months ago manonlumeau NXDOC-1650 fix about integrating changes, add mention on multiple attempts
2 years ago Julien Carsique 14
2 years ago Julien Carsique 13
2 years ago Bertrand Chauvin 12 | update maven version info
3 years ago Manon Lumeau 11 | Fix Studio menu label
3 years ago Julien Carsique 10 | New Plugin template
3 years ago Solen Guitter 9 | NXDOC-658: Marketplace packages are now called Nuxeo Packages
4 years ago Anahide Tchertchian 8 | mention that jenkins_pub is for public Studio projects
4 years ago Julien Carsique 7
5 years ago Manon Lumeau 6
5 years ago Manon Lumeau 4
5 years ago Manon Lumeau 5
5 years ago Julien Carsique 3
5 years ago Julien Carsique 2
5 years ago Julien Carsique 1
History: Created by Julien Carsique

We'd love to hear your thoughts!

All fields required