Add support to start mongodb for python job
[releng/builder.git] / jjb / releng-templates.yaml
index 2524680769b6b9428828ecaa3dd99e1e29ac4fa5..3774943131b69e74e4fe8613c1f87ba6659d15a8 100644 (file)
-# ODL Releng build templates
-
 - job-template:
-    name: '{name}-verify-{stream}'
+    name: '{name}-release-java'
 
-    # Job template for ODL verify jobs
-    #
-    # The purpose of this job template is to setup a ODL verify job
-    #
-    # Required Variables:
-    #     name:      project name (eg. controller)
-    #     stream:    branch with - in place of / (eg. stable/helium)
-    #     branch:    branch (eg. stable/helium)
-    #     mvn-goals: Maven Goals parameter to pass to the builder (eg. clean install)
-    #     mvn-opts:  MAVEN_OPTS paramter to pass to the builder (eg. -Xmx1024m)
-    #
-    # Optional Variables:
-    #     build-days-to-keep:           Number of days to keep builds
-    #     build-num-to-keep:            Number of builds to keep
-    #     build-artifact-days-to-keep:  Number of artifacts from builds to keep
-    #     build-artifact-num-to-keep:   Number of builds to keep with artifacts
+    # Job template for producing a release candidate by creating a staging repo
+    # in Nexus.
 
     project-type: maven
+    node: dynamic_merge
+    jdk: '{jdk}'
 
     logrotate:
-        daysToKeep: '{build-days-to-keep}'
-        numToKeep: '{build-num-to-keep}'
-        artifactDaysToKeep: '{build-artifact-days-to-keep}'
-        artifactNumToKeep: '{build-artifact-num-to-keep}'
+        daysToKeep: '30'
 
     parameters:
-        - gerrit-parameter:
-            branch: '{branch}'
+        - project-parameter:
+            project: '{project}'
+        - build-tag
+        - stage-id-parameter:
+            stage-id: '{stage-id}'
 
     scm:
-        - gerrit-trigger-scm:
+        - git:
             credentials-id: '{ssh-credentials}'
-            scm-url: '{scm-url}'
-            refspec: '$GERRIT_REFSPEC'
+            url: '$GIT_BASE'
+            branches:
+                - '$BUILD_TAG'
+            skip-tag: true
+            shallow-clone: true
+            wipe-workspace: true
 
     wrappers:
+        - build-timeout
         - ssh-agent-credentials:
-            user: '{ssh-credentials}'
+            users:
+                - '{ssh-credentials}'
 
-    triggers:
-        - gerrit-trigger-patch-submitted:
-            name: '{name}'
-            branch: '{branch}'
+    prebuilders:
+        - wipe-org-opendaylight-repo
+        - jacoco-nojava-workaround
+        - provide-maven-settings:
+            global-settings-file: '{odl-global-settings}'
+            settings-file: '{autorelease-settings}'
 
     maven:
-        maven-name: Maven 3.0.4
-        root-pom: pom.xml
-        goals: '{mvn-goals}'
-        maven-opts: '{mvn-opts}'
+        maven-name: '{mvn33}'
+        root-pom: 'pom.xml'
+        goals: 'clean deploy -V -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r  -Djenkins -DaltDeploymentRepository=staging::default::file:hide/from/pom/files/stage'
+        maven-opts: '-Xmx1024m -XX:MaxPermSize=256m'
+        settings: '{autorelease-settings}'
+        global-settings: '{odl-global-settings}'
+        post-step-run-condition: UNSTABLE
+
+    postbuilders:
+        - releng-stage-release
 
     publishers:
+        - archive-artifacts:
+            artifacts: '*.log'
         - email-notification:
-            email-prefix: '{email-prefix}'
+            email-prefix: '[releng]'
+
 
 - job-template:
-    name: '{name}-merge-{stream}'
+    name: '{name}-publish-p2repo'
 
-    # Job template for ODL merge jobs
-    #
-    # The purpose of this job template is to setup a ODL merge job
-    #
-    # Required Variables:
-    #     name:      project name (eg. controller)
-    #     stream:    branch with - in place of / (eg. stable/helium)
-    #     branch:    branch (eg. stable/helium)
-    #     mvn-goals: Maven Goals parameter to pass to the builder (eg. clean install)
-    #     mvn-opts:  MAVEN_OPTS paramter to pass to the builder (eg. -Xmx1024m)
-    #
-    # Optional Variables:
-    #     build-days-to-keep:           Number of days to keep builds
-    #     build-num-to-keep:            Number of builds to keep
-    #     build-artifact-days-to-keep:  Number of artifacts from builds to keep
-    #     build-artifact-num-to-keep:   Number of builds to keep with artifacts
+    # Job template for publishing a p2 repo given a URL to a zipped p2repo.
 
     project-type: maven
+    node: dynamic_merge
+    jdk: '{jdk}'
 
-    logrotate:
-        daysToKeep: '{build-days-to-keep}'
-        numToKeep: '{build-num-to-keep}'
-        artifactDaysToKeep: '{build-artifact-days-to-keep}'
-        artifactNumToKeep: '{build-artifact-num-to-keep}'
-
-    scm:
-        - gerrit-trigger-scm:
-            credentials-id: '{ssh-credentials}'
-            scm-url: '{scm-url}'
-            refspec: ''
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - p2zip-parameter
 
-    wrappers:
-        - ssh-agent-credentials:
-            user: '{ssh-credentials}'
-
-    triggers:
-        - gerrit-trigger-patch-merged:
-            name: '{name}'
-            branch: '{branch}'
+    prebuilders:
+        - wipe-org-opendaylight-repo
+        - jacoco-nojava-workaround
+        - releng-generate-p2pom
 
     maven:
-        maven-name: Maven 3.0.4
-        root-pom: pom.xml
-        goals: '{mvn-goals}'
-        maven-opts: '{mvn-opts}'
+        maven-name: '{mvn33}'
+        root-pom: 'pom.xml'
+        goals: 'clean deploy -V -Dmaven.repo.local=/tmp/r'
+        settings: '{project-settings}'
+        global-settings: '{odl-global-settings}'
+        post-step-run-condition: UNSTABLE
+
+    postbuilders:
+        - releng-update-p2composite-metadata:
+            maven-version: '{mvn33}'
+            settings: '{project-settings}'
+            global-settings: '{odl-global-settings}'
 
     publishers:
         - email-notification:
-            email-prefix: '{email-prefix}'
-        - maven-deploy:
-            id:
-            url:
-            unique-version: true
-            deploy-unstable: false
+            email-prefix: '[releng]'
 
 - job-template:
-    name: '{name}-daily-{stream}'
+    name: '{name}-verify-python-{stream}'
 
-    # Job template for daily builders
+    # Job template for python verify jobs
     #
-    # The purpose of this job template is to setup a daily/nightly builder and pushes to Sonar analysis.
+    # The purpose of this job template is to run tox for projects using this
+    # template.
     #
     # Required Variables:
-    #     name:      project name (eg. controller)
-    #     stream:    branch with - in place of / (eg. stable/helium)
-    #     branch:    branch (eg. stable/helium)
-    #     mvn-goals: Maven Goals parameter to pass to the builder (eg. clean install)
-    #     mvn-opts:  MAVEN_OPTS paramter to pass to the builder (eg. -Xmx1024m)
-    #
-    # Optional Variables:
-    #     build-days-to-keep:           Number of days to keep builds
-    #     build-num-to-keep:            Number of builds to keep
-    #     build-artifact-days-to-keep:  Number of artifacts from builds to keep
-    #     build-artifact-num-to-keep:   Number of builds to keep with artifacts
+    #     stream:    release stream (eg. stable-lithium or beryllium)
+    #     branch:    git branch (eg. stable/lithium or master)
+    #     toxdir:    directory containing the project's tox.ini relative to
+    #                the workspace.
 
-    project-type: maven
+    project-type: freestyle
+    node: dynamic_verify
+    concurrent: true
 
     logrotate:
-        daysToKeep: '{build-days-to-keep}'
-        numToKeep: '{build-num-to-keep}'
-        artifactDaysToKeep: '{build-artifact-days-to-keep}'
-        artifactNumToKeep: '{build-artifact-num-to-keep}'
+        daysToKeep: '7'
+        numToKeep: '-1'
+        artifactDaysToKeep: '-1'
+        artifactNumToKeep: '-1'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
+            branch: '{branch}'
+        - gerrit-refspec-parameter:
+            refspec: 'refs/heads/{branch}'
+        - bool:
+            name: START_MONGO
+            default: '{start-mongo}'
+            description: "Whether or not to start a mongo process."
 
     scm:
-        - git-scm:
+        - git:
             credentials-id: '{ssh-credentials}'
-            scm-url: '{scm-url}'
-            refspec: ''
+            url: '$GIT_BASE'
+            basedir: 'repo'
+            refspec: '$GERRIT_REFSPEC'
+            branches:
+                - 'origin/$GERRIT_BRANCH'
+            skip-tag: true
+            choosing-strategy: 'gerrit'
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            users:
+                - '{ssh-credentials}'
+
+    triggers:
+        - gerrit:
+            server-name: 'OpenDaylight'
+            trigger-on:
+                - patchset-created-event:
+                    exclude-drafts: 'true'
+                    exclude-trivial-rebase: 'false'
+                    exclude-no-code-change: 'true'
+                - draft-published-event
+                - comment-added-contains-event:
+                    comment-contains-value: 'recheck'
+                - comment-added-contains-event:
+                    comment-contains-value: 'reverify'
+            projects:
+              - project-compare-type: 'ANT'
+                project-pattern: '{project}'
+                branches:
+                  - branch-compare-type: 'ANT'
+                    branch-pattern: '**/{branch}'
+                file-paths:
+                    - compare-type: ANT
+                      pattern: '{toxdir}/**'
+
+    builders:
+        - shell: |
+            virtualenv $WORKSPACE/venv-tox
+            source $WORKSPACE/venv-tox/bin/activate
+            pip install --upgrade pip
+            pip install --upgrade tox argparse
+            pip freeze
+
+            echo $START_MONGO
+            if [ "$START_MONGO" == "true" ]; then
+                mkdir $WORKSPACE/mongo
+                mongod --dbpath $WORKSPACE/mongo
+            fi
+
+            cd $WORKSPACE/repo/{toxdir}
+            tox
+
+    publishers:
+        - email-notification:
+            email-prefix: '[{project}]'
+
+- job-template:
+    name: '{name}-merge-rtd-{stream}'
+    # Template for ReadTheDocs triggering
+
+    project-type: freestyle
+    node: dynamic_verify
+    concurrent: false
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
             branch: '{branch}'
+        - gerrit-refspec-parameter:
+            refspec: 'refs/heads/{branch}'
 
     wrappers:
+        - build-timeout
         - ssh-agent-credentials:
-            user: '{ssh-credentials}'
+            users:
+                - '{ssh-credentials}'
 
     triggers:
-        - timed: 'H H * * *'
+        - gerrit-trigger-patch-merged:
+            name: '{project}'
+            branch: '{branch}'
 
-    maven:
-        maven-name: Maven 3.0.4
-        root-pom: pom.xml
-        goals: '{mvn-goals}'
-        maven-opts: '{mvn-opts}'
+    builders:
+        - shell: |
+            curl -X POST https://readthedocs.org/build/{rtdproject}
 
     publishers:
         - email-notification:
-            email-prefix: '{email-prefix}'
-        - sonar:
-            branch: 'origin/{branch}'
-            language: 'java'
-            maven-opts: '{mvn-opts}'
+            email-prefix: '[{project}]'