Merge "Yangtools-jobs build against multiple JDKs"
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Wed, 7 Jan 2015 20:48:06 +0000 (20:48 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 7 Jan 2015 20:48:06 +0000 (20:48 +0000)
19 files changed:
.gitignore
README.md
jjb/bgpcep/bgpcep.yaml
jjb/controller/controller.yaml
jjb/include-raw-jjb-update.sh
jjb/job.yaml.template
jjb/l2switch/l2switch.yaml
jjb/odlparent/odlparent.yaml
jjb/openflowjava/openflowjava.yaml
jjb/openflowplugin/openflowplugin.yaml
jjb/releng-defaults.yaml
jjb/sfc/sfc.yaml
jjb/tcpmd5/tcpmd5.yaml
jjb/topoprocessing/topoprocessing.cfg [new file with mode: 0644]
jjb/topoprocessing/topoprocessing.yaml [new file with mode: 0644]
jjb/ttp/ttp.yaml
jjb/yangtools/yangtools-verify.yaml
scripts/jjb-autoupdate-project.py
scripts/jjb-init-project.py

index 1377554ebea6f98a2c748183bc5a96852af12ac2..6aca512152fdfe75414c8cbaecdb812852cf05a6 100644 (file)
@@ -1 +1,4 @@
 *.swp
+
+# Ignore changes to the JJB Configuration File
+jenkins.ini
index a738f712da11cd8f7d908c48762fd0880a93c907..efb5259942c7592081687c6d57fe2faf4321df68 100644 (file)
--- a/README.md
+++ b/README.md
@@ -81,6 +81,13 @@ containing your project's base template.
     #                         will trigger when a dependent project-merge job
     #                         is built successfully.
     #          Example      : aaa,controller,yangtools
+    #
+    # -z / --no-cfg         : Do not auto-generate a project.cfg file if
+    #                         -g, -o, -d parameters are passed. Usually
+    #                         when these parameters are passed we will
+    #                         assume customizations are made and create
+    #                         the project file. (Useful in scripts like
+    #                         the jjb-autoupdate-project.py script)
 
 If all your project requires is the basic verify, merge, and
 daily jobs then using the job.template should be all you need to
index 70bbb6e5186e34d7cba65c18a11fec064c07eace..6bdc0761c58b0a190881937fd4b4a18e540e6443 100644 (file)
@@ -40,6 +40,7 @@
 
     project-type: maven
     node: dynamic_verify
+    concurrent: true
     jdk: '{jdk}'
 
     logrotate:
index dfecce72323a5c50ab63f9cf1e6a18354c7fbdc5..14aab3c30672bb3801c3efbee69db0ba16e8efb2 100644 (file)
@@ -40,6 +40,7 @@
 
     project-type: maven
     node: dynamic_verify
+    concurrent: true
     jdk: '{jdk}'
 
     logrotate:
@@ -74,7 +75,7 @@
         maven-name: '{mvn32}'
         root-pom: 'pom.xml'
         goals: '-Dmaven.repo.local=$WORKSPACE/.m2repo -Dorg.ops4j.pax.url.mvn.localRepository=$WORKSPACE/.m2repo clean install -Pintegrationtests,docs'
-        maven-opts: '-Xmx4096m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
+        maven-opts: '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
         settings: '{controller-settings}'
         global-settings: '{odl-global-settings}'
         ignore-upstream-changes: true
         maven-name: '{mvn32}'
         root-pom: 'pom.xml'
         goals: '-Dmaven.repo.local=$WORKSPACE/.m2repo -Dorg.ops4j.pax.url.mvn.localRepository=$WORKSPACE/.m2repo clean install -Pintegrationtests,docs'
-        maven-opts: '-Xmx4096m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
+        maven-opts: '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
         settings: '{controller-settings}'
         global-settings: '{odl-global-settings}'
 
         maven-name: '{mvn32}'
         root-pom: 'pom.xml'
         goals: '-Dmaven.repo.local=$WORKSPACE/.m2repo -Dorg.ops4j.pax.url.mvn.localRepository=$WORKSPACE/.m2repo clean install -Pintegrationtests,docs'
-        maven-opts: '-Xmx4096m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
+        maven-opts: '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
         settings: '{controller-settings}'
         global-settings: '{odl-global-settings}'
 
         - sonar:
             branch: '{stream}'
             language: 'java'
-            maven-opts: '-Xmx4096m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
+            maven-opts: '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
 
 - job-template:
     name: 'controller-integration-{stream}'
         maven-name: '{mvn32}'
         root-pom: 'pom.xml'
         goals: '-Dmaven.repo.local=$WORKSPACE/.m2repo -Dorg.ops4j.pax.url.mvn.localRepository=$WORKSPACE/.m2repo clean install -Pintegrationtests,docs'
-        maven-opts: '-Xmx4096m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
+        maven-opts: '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
         settings: '{controller-settings}'
         global-settings: '{odl-global-settings}'
 
index 5261e48dfdcb257f9f5c3d1ab13b02bce7a60f0e..0aa0c669a9f9f64de7de4eedb5276b83f7e585ff 100644 (file)
@@ -9,4 +9,4 @@ function submitJJB {
 
 gitdir=$(git rev-parse --git-dir); scp -p -P 29418 jenkins-releng@git.opendaylight.org:hooks/commit-msg ${gitdir}/hooks/
 python scripts/jjb-autoupdate-project.py
-git diff --quiet --exit-code || submitJJB
+git diff --exit-code || submitJJB
index 84d4c9131f612a7713b66cfbfd9ddc7c7a70ea35..50b0f1c158d01d8559c5d02c64d1c55cf9d0f276 100644 (file)
@@ -40,6 +40,7 @@
 
     project-type: maven
     node: dynamic_verify
+    concurrent: true
     jdk: '{jdk}'
 
     logrotate:
index a3d389177c482445986f77a960cb27b6030a68f8..ef7d5b02762c9a3911939c2935aa8f2cb6f6b4b3 100644 (file)
@@ -40,6 +40,7 @@
 
     project-type: maven
     node: dynamic_verify
+    concurrent: true
     jdk: '{jdk}'
 
     logrotate:
index c7016eb3a38d0da24a8e9d44b5de5a573d29be57..d290c55ee0c96787ada4777eca587a1f9666165f 100644 (file)
@@ -40,6 +40,7 @@
 
     project-type: maven
     node: dynamic_verify
+    concurrent: true
     jdk: '{jdk}'
 
     logrotate:
index e3ce0fe4d8e96cb61c9a875676b37533fe47523c..14adf1f30e6551c21efd296c740117056f58a6a4 100644 (file)
@@ -40,6 +40,7 @@
 
     project-type: maven
     node: dynamic_verify
+    concurrent: true
     jdk: '{jdk}'
 
     logrotate:
index a5f70dad17ffd44ee9080680764bb539f53d3350..8ce5fc0c704e46134186d17b83ee349358eb7648 100644 (file)
@@ -40,6 +40,7 @@
 
     project-type: maven
     node: dynamic_verify
+    concurrent: true
     jdk: '{jdk}'
 
     logrotate:
index 742ff147ed0524e3559d22a5f0afabe1e1369b96..8ad94066d4a2ae49c6abb1e1783e9963de1f912c 100644 (file)
@@ -13,7 +13,7 @@
     # Maven versions
     mvn30: 'Maven 3.0.5'
     mvn31: 'Maven 3.1.1'
-    mvn32: 'Maven 3.2.3'
+    mvn32: 'Maven 3.2.5'
 
     # Config File Provider ID mapping
     odl-global-settings: 'org.jenkinsci.plugins.configfiles.maven.GlobalMavenSettingsConfig1414604295262'
index 0c3a08b6a1f345590b2a710b8631c4794b984838..a5485b229b1c58383e43b7ce657e81c235c9674d 100644 (file)
@@ -40,6 +40,7 @@
 
     project-type: maven
     node: dynamic_verify
+    concurrent: true
     jdk: '{jdk}'
 
     logrotate:
index 812aaf9f320ddaec231559420d23a61848de852b..6185284607d14be86c38d1393818da8ede8e40a2 100644 (file)
@@ -40,6 +40,7 @@
 
     project-type: maven
     node: dynamic_verify
+    concurrent: true
     jdk: '{jdk}'
 
     logrotate:
diff --git a/jjb/topoprocessing/topoprocessing.cfg b/jjb/topoprocessing/topoprocessing.cfg
new file mode 100644 (file)
index 0000000..dc50acd
--- /dev/null
@@ -0,0 +1 @@
+DEPENDENCIES: controller,yangtools
\ No newline at end of file
diff --git a/jjb/topoprocessing/topoprocessing.yaml b/jjb/topoprocessing/topoprocessing.yaml
new file mode 100644 (file)
index 0000000..0482db1
--- /dev/null
@@ -0,0 +1,249 @@
+# ODL Releng build templates
+- project:
+    name: topoprocessing
+    jobs:
+        - 'topoprocessing-verify-{stream}'
+        - 'topoprocessing-merge-{stream}'
+        - 'topoprocessing-daily-{stream}'
+        - 'topoprocessing-integration-{stream}'
+
+    # stream:    branch with - in place of / (eg. stable-helium)
+    # branch:    branch (eg. stable/helium)
+    stream:
+        - master:
+            branch: 'master'
+        - stable-helium:
+            branch: 'stable/helium'
+
+    project: 'topoprocessing'
+    jdk: 'openjdk7'
+
+# For the Job templates below replace instances of:
+# PROJECT with your project name (eg. controller)
+# MAVEN_GOALS with your maven goals to build
+# MAVEN_OPTS with your maven options to build
+
+- job-template:
+    name: 'topoprocessing-verify-{stream}'
+
+    # Job template for ODL verify jobs
+    #
+    # The purpose of this job template is to setup a ODL verify job
+    #
+    # Required Variables:
+    #     stream:    branch with - in place of / (eg. stable-helium)
+    #     branch:    branch (eg. stable/helium)
+
+    project-type: maven
+    node: dynamic_verify
+    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}'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
+            branch: '{branch}'
+
+    scm:
+        - gerrit-trigger-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: '$GERRIT_REFSPEC'
+            choosing-strategy: 'gerrit'
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            user: '{ssh-credentials}'
+
+    triggers:
+        - gerrit-trigger-patch-submitted:
+            name: 'topoprocessing'
+            branch: '{branch}'
+
+    maven:
+        maven-name: '{mvn32}'
+        root-pom: 'pom.xml'
+        goals: 'clean install -V -Dmaven.repo.local=$WORKSPACE/.m2repo -Dorg.ops4j.pax.url.mvn.localRepository=$WORKSPACE/.m2repo '
+        maven-opts: '-Xmx1024m -XX:MaxPermSize=256m'
+        settings: '{topoprocessing-settings}'
+        global-settings: '{odl-global-settings}'
+        ignore-upstream-changes: true
+
+    publishers:
+        - email-notification:
+            email-prefix: '[topoprocessing]'
+
+- job-template:
+    name: 'topoprocessing-merge-{stream}'
+
+    # Job template for ODL merge jobs
+    #
+    # The purpose of this job template is to setup a ODL merge job
+    # and deploy artifacts to Nexus.
+    #
+    # Required Variables:
+    #     stream:    branch with - in place of / (eg. stable-helium)
+    #     branch:    branch (eg. stable/helium)
+
+    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}'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+
+    scm:
+        - gerrit-trigger-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            choosing-strategy: 'default'
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            user: '{ssh-credentials}'
+
+    triggers:
+        - gerrit-trigger-patch-merged:
+            name: 'topoprocessing'
+            branch: '{branch}'
+
+    maven:
+        maven-name: '{mvn32}'
+        root-pom: 'pom.xml'
+        goals: 'clean install -V -Dmaven.repo.local=$WORKSPACE/.m2repo -Dorg.ops4j.pax.url.mvn.localRepository=$WORKSPACE/.m2repo '
+        maven-opts: '-Xmx1024m -XX:MaxPermSize=256m'
+        settings: '{topoprocessing-settings}'
+        global-settings: '{odl-global-settings}'
+
+    publishers:
+        - email-notification:
+            email-prefix: '[topoprocessing]'
+        - maven-deploy:
+            id: ''
+            unique-version: true
+            deploy-unstable: false
+
+- job-template:
+    name: 'topoprocessing-daily-{stream}'
+
+    # Job template for daily builders
+    #
+    # The purpose of this job template is to setup a daily/nightly
+    # builder and pushes to Sonar analysis.
+    #
+    # Required Variables:
+    #     stream:    branch with - in place of / (eg. stable-helium)
+    #     branch:    branch (eg. stable/helium)
+
+    project-type: maven
+    node: dynamic_verify
+    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}'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+
+    scm:
+        - git-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            branch: '{branch}'
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            user: '{ssh-credentials}'
+
+    triggers:
+        - timed: 'H H * * *'
+
+    maven:
+        maven-name: '{mvn32}'
+        root-pom: 'pom.xml'
+        goals: 'clean install -V -Dmaven.repo.local=$WORKSPACE/.m2repo -Dorg.ops4j.pax.url.mvn.localRepository=$WORKSPACE/.m2repo '
+        maven-opts: '-Xmx1024m -XX:MaxPermSize=256m'
+        settings: '{topoprocessing-settings}'
+        global-settings: '{odl-global-settings}'
+
+    publishers:
+        - email-notification:
+            email-prefix: '[topoprocessing]'
+        - sonar:
+            branch: '{stream}'
+            language: 'java'
+            maven-opts: '-Xmx1024m -XX:MaxPermSize=256m'
+
+- job-template:
+    name: 'topoprocessing-integration-{stream}'
+    disabled: false
+
+    # Job template for ODL merge jobs
+    #
+    # The purpose of this job template is to setup a ODL merge job
+    # and deploy artifacts to Nexus.
+    #
+    # Required Variables:
+    #     stream:    branch with - in place of / (eg. stable-helium)
+    #     branch:    branch (eg. stable/helium)
+
+    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}'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+
+    scm:
+        - git-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            branch: '{branch}'
+
+    wrappers:
+        - build-timeout
+        - ssh-agent-credentials:
+            user: '{ssh-credentials}'
+
+    triggers:
+        - reverse:
+            jobs: 'controller-merge-{stream},yangtools-merge-{stream}'
+            result: 'success'
+
+    maven:
+        maven-name: '{mvn32}'
+        root-pom: 'pom.xml'
+        goals: 'clean install -V -Dmaven.repo.local=$WORKSPACE/.m2repo -Dorg.ops4j.pax.url.mvn.localRepository=$WORKSPACE/.m2repo '
+        maven-opts: '-Xmx1024m -XX:MaxPermSize=256m'
+        settings: '{topoprocessing-settings}'
+        global-settings: '{odl-global-settings}'
+
+    publishers:
+        - email-notification:
+            email-prefix: '[topoprocessing] [controller] [yangtools]'
index 74c88b0d2f9b7a3d48e8931750db6a401b72ef22..e13676bb102a4716b9ce9a145fb5901a01fed337 100644 (file)
@@ -40,6 +40,7 @@
 
     project-type: maven
     node: dynamic_verify
+    concurrent: true
     jdk: '{jdk}'
 
     logrotate:
index fec1db38fecc36654d58205695ee088c05823e25..8700dd616fe6853c6a57c24319b08a348f41a068 100644 (file)
@@ -10,7 +10,7 @@
         - mvn31:
             mvnver: "Maven 3.1.1"
         - mvn32:
-            mvnver: "Maven 3.2.3"
+            mvnver: "Maven 3.2.5"
 
     stream:
         - master:
@@ -31,7 +31,7 @@
         - mvn31:
             mvnver: "Maven 3.1.1"
         - mvn32:
-            mvnver: "Maven 3.2.3"
+            mvnver: "Maven 3.2.5"
 
     stream:
         - stable-helium:
index 68d255dde162f64d2dac71901e5df10d804dcbab..ea1977940375301bc39606b1163062b11b51e98a 100644 (file)
@@ -38,6 +38,7 @@ def update_templates(projects):
         # If project has customized variables
         cfg_file = "jjb/%s/%s.cfg" % (project, project)
         parameters = ["python scripts/jjb-init-project.py"]
+        parameters.append("-z")  # Disable CFG auto-generation
         if os.path.isfile(cfg_file):
             stream = open(cfg_file, "r")
             cfg = yaml.load(stream)
@@ -54,7 +55,7 @@ def update_templates(projects):
             os.system(cmd)
 
         else:
-            os.system("python scripts/jjb-init-project.py %s" % project)
+            os.system("python scripts/jjb-init-project.py -z %s" % project)
 
 ##############
 # Code Start #
index 4c60ce62567d447c971d85bd832ef37827f61d62..b6d3994d6394fb6ac3d756a9a032a3e6fab899dc 100644 (file)
@@ -29,6 +29,8 @@ parser.add_argument("-d", "--dependencies",
                           "Example: aaa,controller,yangtools"))
 parser.add_argument("-g", "--mvn-goals", help="Maven Goals")
 parser.add_argument("-o", "--mvn-opts", help="Maven Options")
+parser.add_argument("-z", "--no-cfg", action="store_true",
+                    help=("Disable initializing the project.cfg file."))
 args = parser.parse_args()
 
 project = args.project
@@ -43,21 +45,42 @@ email_prefix = "[%s]" % project
 
 template_file = os.path.join("jjb", "job.yaml.template")
 
+# The below 2 variables are used to determine if we should generate a CFG file
+# for a project automatically.
+#
+# no_cfg - is a commandline parameter that can be used by scripts such as the
+#          jjb-autoupdate-project script to explicitly disable generating CFG
+#          files.
+# make_cfg - is a internal variable used to decide if we should try to
+#            auto generate the CFG file for a project based on optional
+#            variables passed by the user on the commandline.
+no_cfg = args.no_cfg
+make_cfg = False  # Set to true if we need to generate initial CFG file
+cfg_string = []
+
 if not mvn_goals:
     mvn_goals = ("clean install "
                  "-V "  # Show Maven / Java version before building
                  "-Dmaven.repo.local=$WORKSPACE/.m2repo "
                  "-Dorg.ops4j.pax.url.mvn.localRepository=$WORKSPACE/.m2repo ")
+else:  # User explicitly set MAVEN_OPTS so create CFG
+    make_cfg = True
+    cfg_string.append("MAVEN_GOALS: %s" % mvn_goals)
 
 if not mvn_opts:
     mvn_opts = "-Xmx1024m -XX:MaxPermSize=256m"
+else:  # User explicitly set MAVEN_OPTS so create CFG
+    make_cfg = True
+    cfg_string.append("MAVEN_OPTS: %s" % mvn_opts)
 
 if dependencies:
+    make_cfg = True
     disabled = "false"
     email_prefix = (email_prefix + " " +
                     " ".join(['[%s]' % d for d in dependencies.split(",")]))
     dependent_jobs = ",".join(
         ['%s-merge-{stream}' % d for d in dependencies.split(",")])
+    cfg_string.append("DEPENDENCIES: %s" % dependencies)
 
 # Create project directory if it doesn't exist
 if not os.path.exists(project_dir):
@@ -72,6 +95,14 @@ print("project: %s\n"
        mvn_opts,
        dependencies))
 
+# Create initial project CFG file
+if not no_cfg and make_cfg:
+    print("Creating %s.cfg file" % project)
+    cfg_file = os.path.join(project_dir, "%s.cfg" % project)
+    with open(cfg_file, "w") as outstream:
+        cfg = "\n".join(cfg_string)
+        outstream.write(cfg)
+
 # Create initial project YAML file
 with open(template_file, "r") as infile:
     with open(project_file, "w") as outfile: