Add JENKINS_SETTINGS variable to handle project-settings 84/26484/3
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 3 Sep 2015 21:35:54 +0000 (17:35 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 3 Sep 2015 22:04:04 +0000 (18:04 -0400)
This fixes bug where meta-projects were picking up the incorrect
project-settings configuration for JJB.

Change-Id: I5b422bb59e1631281d38b2486d7a141e1059d54f
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
jjb-templates/clm.yaml
jjb-templates/daily.yaml
jjb-templates/integration.yaml
jjb-templates/merge.yaml
jjb-templates/sonar.yaml
jjb-templates/verify.yaml
scripts/jjb-init-project.py

index 80249ba5679162cd312b3bf69f7371e9d912942c..6c92aa34e1f87a1a9ba6ba4000ebba80cdc5e9bf 100644 (file)
@@ -38,7 +38,7 @@
         root-pom: 'pom.xml'
         goals: 'com.sonatype.clm:clm-maven-plugin:index -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
         maven-opts: '-Xmx4096m -XX:MaxPermSize=512m'
-        settings: '{PROJECT-settings}'
+        settings: '{JENKINS_SETTINGS}'
         global-settings: '{odl-global-settings}'
 
     postbuilders:
index 1751656716668904123ccab4a0de7fdb07ce32ce..df0f0af96f619c240d27edb865b029eb1ed00f8b 100644 (file)
@@ -48,7 +48,7 @@
         root-pom: 'POM'
         goals: 'MAVEN_GOALS'
         maven-opts: 'MAVEN_OPTS'
-        settings: '{PROJECT-settings}'
+        settings: '{JENKINS_SETTINGS}'
         global-settings: '{odl-global-settings}'
 
     reporters:
index d6ff863ea02cd1c7dc5fc670f0550194b98d1e66..7e7c1ab9afc0a0960b00fda6d12ba198df4dab3f 100644 (file)
@@ -52,7 +52,7 @@
         root-pom: 'POM'
         goals: 'MAVEN_GOALS'
         maven-opts: 'MAVEN_OPTS'
-        settings: '{PROJECT-settings}'
+        settings: '{JENKINS_SETTINGS}'
         global-settings: '{odl-global-settings}'
 
     reporters:
index 334d41674973455bfc0bdb27dbe1dbe9c39f8df5..2061221d2a5c0adf4eda9bdac1cb58a7c5fe9404 100644 (file)
@@ -50,7 +50,7 @@
         root-pom: 'POM'
         goals: 'MAVEN_GOALS -Dmerge'
         maven-opts: 'MAVEN_OPTS'
-        settings: '{PROJECT-settings}'
+        settings: '{JENKINS_SETTINGS}'
         global-settings: '{odl-global-settings}'
 
     reporters:
index 28351abaa4987a08804447b94fca38bb9f77425c..d2faa26555c05d84bfef6a07dd7b0177d61fdfe9 100644 (file)
@@ -41,7 +41,7 @@
         root-pom: 'POM'
         goals: 'MAVEN_GOALS -Dsonar'
         maven-opts: 'MAVEN_OPTS'
-        settings: '{PROJECT-settings}'
+        settings: '{JENKINS_SETTINGS}'
         global-settings: '{odl-global-settings}'
 
     reporters:
index 2af97cd31179bf83fc1a785c3bb056bdc46a33d4..0c551d9e9ebcf38135c5bc36f37e7b801fc53d62 100644 (file)
@@ -61,7 +61,7 @@
             goals: 'MAVEN_GOALS'
             java-opts:
                 - 'MAVEN_OPTS'
-            settings: '{PROJECT-settings}'
+            settings: '{JENKINS_SETTINGS}'
             global-settings: '{odl-global-settings}'
 
     publishers:
index c2ec670407bb29ba7984b09783f1cd5932c9ca48..f9273c88a5235dda6df1cead779249a8db5436a4 100644 (file)
@@ -28,14 +28,18 @@ args = jjblib.parse_jjb_args()
 project = jjblib.Project(args.project)
 if project.meta_project is not None:
     project_dir = os.path.join("jjb", project.meta_project, project.project)
+    jenkins_settings = "%s-%s-settings" % (project.meta_project,
+                                           project.project)
 else:
     project_dir = os.path.join("jjb", project.project)
+    jenkins_settings = "%s-settings" % project.project
 
 project_file = os.path.join(project_dir, "%s.yaml" % project)
 dependent_jobs = ""
 disabled = "true"   # Always disabled unless project has dependencies
 email_prefix = "[%s]" % project
 
+
 if not args.conf:
     jjblib.create_template_config(project_dir, args)
     project_conf = os.path.join(project_dir, "%s.cfg" % args.project)
@@ -188,6 +192,7 @@ with open(project_file, "w") as outfile:
                 if not re.match("\s*#", line):
                     line = re.sub("JOB_TEMPLATES", job_templates_yaml, line)
                     line = re.sub("PROJECT", project.project, line)
+                    line = re.sub("JENKINS_SETTINGS", jenkins_settings, line)
                     line = re.sub("DISABLED", disabled, line)
                     line = re.sub("STREAMS", str_streams, line)
                     line = re.sub("POM", pom, line)