add the jobs to generate buildlogs directory in repository
authorHasan Wan <hasan.wan@intel.com>
Fri, 22 Nov 2013 07:24:33 +0000 (09:24 +0200)
committerGerrit Code Review <gerrit2@otctools.fi.intel.com>
Thu, 28 Nov 2013 14:17:42 +0000 (16:17 +0200)
Change-Id: Ib9afc53dad70559f470c3fec35ffb47235828fac
Signed-off-by: Hasan Wan <hasan.wan@intel.com>
jobs/buildlogs/config.xml [new file with mode: 0644]
packaging/jenkins-jobs.spec

diff --git a/jobs/buildlogs/config.xml b/jobs/buildlogs/config.xml
new file mode 100644 (file)
index 0000000..3892f1c
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<project>
+  <actions/>
+  <description>Job to collect buildlogs and sync to target snapshot, this jobs must be run on OBS server</description>
+  <logRotator class="hudson.tasks.LogRotator">
+    <daysToKeep>7</daysToKeep>
+    <numToKeep>1000</numToKeep>
+    <artifactDaysToKeep>-1</artifactDaysToKeep>
+    <artifactNumToKeep>-1</artifactNumToKeep>
+  </logRotator>
+  <keepDependencies>false</keepDependencies>
+  <properties>
+    <hudson.queueSorter.PrioritySorterJobProperty plugin="PrioritySorter@1.3">
+      <priority>100</priority>
+    </hudson.queueSorter.PrioritySorterJobProperty>
+  </properties>
+  <scm class="hudson.scm.NullSCM"/>
+  <quietPeriod>30</quietPeriod>
+  <assignedNode>obs</assignedNode>
+  <canRoam>false</canRoam>
+  <disabled>false</disabled>
+  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
+  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
+  <triggers class="vector"/>
+  <concurrentBuild>false</concurrentBuild>
+  <builders>
+    <hudson.tasks.Shell>
+      <command>#/bin/bash
+
+python ${WORKSPACE}/jenkins-scripts/job_buildlogs.py
+</command>
+    </hudson.tasks.Shell>
+  </builders>
+  <publishers>
+    <org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder plugin="groovy-postbuild@1.8">
+      <groovyScript>def matcher = manager.getLogMatcher(&quot;.*buildid=&apos;(.*)&apos;\$&quot;)
+
+if(matcher?.matches()) {
+    manager.addShortText(matcher.group(1))
+}else{
+    manager.addShortText(&quot;??&quot;)
+}</groovyScript>
+      <behavior>0</behavior>
+    </org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder>
+    <hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup@0.16">
+      <deleteDirs>false</deleteDirs>
+      <skipWhenFailed>false</skipWhenFailed>
+      <cleanWhenSuccess>true</cleanWhenSuccess>
+      <cleanWhenUnstable>true</cleanWhenUnstable>
+      <cleanWhenFailure>true</cleanWhenFailure>
+      <cleanWhenNotBuilt>true</cleanWhenNotBuilt>
+      <cleanWhenAborted>true</cleanWhenAborted>
+      <notFailBuild>false</notFailBuild>
+      <cleanupMatrixParent>false</cleanupMatrixParent>
+    </hudson.plugins.ws__cleanup.WsCleanup>
+  </publishers>
+  <buildWrappers>
+    <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.16">
+      <deleteDirs>false</deleteDirs>
+      <cleanupParameter></cleanupParameter>
+    </hudson.plugins.ws__cleanup.PreBuildCleanup>
+    <com.michelin.cio.hudson.plugins.copytoslave.CopyToSlaveBuildWrapper plugin="copy-to-slave@1.4">
+      <includes>configuration, jenkins-scripts/job_buildlogs.py, jenkins-scripts/common/*</includes>
+      <excludes></excludes>
+      <flatten>false</flatten>
+      <includeAntExcludes>false</includeAntExcludes>
+      <hudsonHomeRelative>false</hudsonHomeRelative>
+      <relativeTo>userContent</relativeTo>
+    </com.michelin.cio.hudson.plugins.copytoslave.CopyToSlaveBuildWrapper>
+    <EnvInjectBuildWrapper plugin="envinject@1.88">
+      <info>
+        <propertiesFilePath>${WORKSPACE}/configuration</propertiesFilePath>
+        <loadFilesFromMaster>false</loadFilesFromMaster>
+      </info>
+    </EnvInjectBuildWrapper>
+  </buildWrappers>
+</project>
\ No newline at end of file
index f117228..a1d28eb 100644 (file)
@@ -84,6 +84,8 @@ fi
 %{destdir}/obs-event-dispatcher/config.xml
 %dir %{destdir}/load-repo-conf/
 %{destdir}/load-repo-conf/config.xml
+%dir %{destdir}/buildlogs/
+%{destdir}/buildlogs/config.xml
 
 %files common
 %defattr(-,jenkins,jenkins)