Precheck VM imager before launching 20/167820/2
authorhyokeun <hyokeun.jeon@samsung.com>
Mon, 22 Jan 2018 08:08:23 +0000 (17:08 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Tue, 23 Jan 2018 22:29:21 +0000 (07:29 +0900)
Change-Id: I5faa70609860bf4a839d76f33438929bcdb97b4d

debian/jenkins-jobs.install
jobs/ondemand_slave_control/config.xml
jobs/ondemand_slave_imager_checker/config.xml [new file with mode: 0644]
packaging/jenkins-jobs.spec

index 8a45275..09d7f16 100644 (file)
@@ -52,6 +52,7 @@ update-public-git /var/lib/jenkins/jobs/
 pre-release-gerrit-group /var/lib/jenkins/jobs/
 pre-release-request /var/lib/jenkins/jobs/
 ondemand_slave_control /var/lib/jenkins/jobs/
+ondemand_slave_imager_checker /var/lib/jenkins/jobs/
 update-gbs-meta /var/lib/jenkins/jobs/
 gbs-ref-fullbuild /var/lib/jenkins/jobs/
 submit-request-git-sync /var/lib/jenkins/jobs/
index 7dbc725..a12d62a 100644 (file)
@@ -12,7 +12,7 @@
     </hudson.plugins.buildblocker.BuildBlockerProperty>
     <jenkins.model.BuildDiscarderProperty>
       <strategy class="hudson.tasks.LogRotator">
-        <daysToKeep>2</daysToKeep>
+        <daysToKeep>10</daysToKeep>
         <numToKeep>-1</numToKeep>
         <artifactDaysToKeep>-1</artifactDaysToKeep>
         <artifactNumToKeep>-1</artifactNumToKeep>
           <description></description>
           <defaultValue>0</defaultValue>
         </hudson.model.StringParameterDefinition>
+        <hudson.model.StringParameterDefinition>
+          <name>SLOT_NUMBERS</name>
+          <description>Comma(,) separated string.</description>
+          <defaultValue></defaultValue>
+        </hudson.model.StringParameterDefinition>
       </parameterDefinitions>
     </hudson.model.ParametersDefinitionProperty>
   </properties>
         <scriptFile>/var/lib/jenkins/jenkins-scripts/job_control_ondemand_slaves.groovy</scriptFile>
       </source>
     </hudson.plugins.groovy.SystemGroovy>
+    <hudson.plugins.parameterizedtrigger.TriggerBuilder plugin="parameterized-trigger@2.33">
+      <configs>
+        <hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
+          <configs class="empty-list"/>
+          <configFactories>
+            <hudson.plugins.parameterizedtrigger.FileBuildParameterFactory>
+              <filePattern>IMAGER_VM_PRE_CHECK_SLOT_*.env</filePattern>
+              <noFilesFoundAction>SKIP</noFilesFoundAction>
+            </hudson.plugins.parameterizedtrigger.FileBuildParameterFactory>
+          </configFactories>
+          <projects>ondemand_slave_imager_checker</projects>
+          <condition>ALWAYS</condition>
+          <triggerWithNoParameters>false</triggerWithNoParameters>
+          <triggerFromChildProjects>false</triggerFromChildProjects>
+          <buildAllNodesWithLabel>false</buildAllNodesWithLabel>
+        </hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
+      </configs>
+    </hudson.plugins.parameterizedtrigger.TriggerBuilder>
   </builders>
   <publishers>
     <org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder plugin="groovy-postbuild@2.3.1">
@@ -87,6 +110,11 @@ if(matcher_title?.matches()) {
       <behavior>0</behavior>
       <runForMatrixParent>false</runForMatrixParent>
     </org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder>
+    <hudson.tasks.Mailer plugin="mailer@1.20">
+      <recipients>hyokeun.jeon@samsung.com</recipients>
+      <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
+      <sendToIndividuals>false</sendToIndividuals>
+    </hudson.tasks.Mailer>
   </publishers>
   <buildWrappers>
     <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.33">
diff --git a/jobs/ondemand_slave_imager_checker/config.xml b/jobs/ondemand_slave_imager_checker/config.xml
new file mode 100644 (file)
index 0000000..499e9b0
--- /dev/null
@@ -0,0 +1,88 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<project>
+  <actions/>
+  <description></description>
+  <keepDependencies>false</keepDependencies>
+  <properties>
+    <hudson.plugins.buildblocker.BuildBlockerProperty plugin="build-blocker-plugin@1.7.3">
+      <useBuildBlocker>false</useBuildBlocker>
+      <blockLevel>UNDEFINED</blockLevel>
+      <scanQueueFor>DISABLED</scanQueueFor>
+      <blockingJobs></blockingJobs>
+    </hudson.plugins.buildblocker.BuildBlockerProperty>
+    <jenkins.model.BuildDiscarderProperty>
+      <strategy class="hudson.tasks.LogRotator">
+        <daysToKeep>2</daysToKeep>
+        <numToKeep>-1</numToKeep>
+        <artifactDaysToKeep>-1</artifactDaysToKeep>
+        <artifactNumToKeep>-1</artifactNumToKeep>
+      </strategy>
+    </jenkins.model.BuildDiscarderProperty>
+    <com.sonyericsson.rebuild.RebuildSettings plugin="rebuild@1.25">
+      <autoRebuild>false</autoRebuild>
+      <rebuildDisabled>false</rebuildDisabled>
+    </com.sonyericsson.rebuild.RebuildSettings>
+    <hudson.model.ParametersDefinitionProperty>
+      <parameterDefinitions>
+        <org.jvnet.jenkins.plugins.nodelabelparameter.LabelParameterDefinition plugin="nodelabelparameter@1.7.2">
+          <name>BACKEND_SELECTION</name>
+          <description></description>
+          <defaultValue>imager-slot</defaultValue>
+          <allNodesMatchingLabel>false</allNodesMatchingLabel>
+          <triggerIfResult>allCases</triggerIfResult>
+          <nodeEligibility class="org.jvnet.jenkins.plugins.nodelabelparameter.node.AllNodeEligibility"/>
+        </org.jvnet.jenkins.plugins.nodelabelparameter.LabelParameterDefinition>
+      </parameterDefinitions>
+    </hudson.model.ParametersDefinitionProperty>
+  </properties>
+  <scm class="hudson.scm.NullSCM"/>
+  <quietPeriod>0</quietPeriod>
+  <canRoam>true</canRoam>
+  <disabled>false</disabled>
+  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
+  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
+  <triggers/>
+  <concurrentBuild>true</concurrentBuild>
+  <builders>
+    <hudson.tasks.Shell>
+      <command>#!/usr/bin/env python
+
+import os, sys
+from time import sleep
+
+for x in [1,2,3]:
+    print &apos;Waiting %s seconds&apos; % (x*10)
+    sys.stdout.flush()
+    sleep(10)
+    </command>
+    </hudson.tasks.Shell>
+  </builders>
+  <publishers>
+    <org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder plugin="groovy-postbuild@2.3.1">
+      <script plugin="script-security@1.28">
+        <script>nodeName = manager.envVars[&apos;NODE_NAME&apos;]
+labelName = manager.envVars[&apos;NODE_LABELS&apos;]
+
+for (node in jenkins.model.Jenkins.instance.nodes) {
+    if (node.getNodeName().equals(nodeName)) {
+        newLabelString = &quot;imager&quot;
+        node.setLabelString(newLabelString)
+        node.save()
+        break
+    }
+}
+</script>
+        <sandbox>false</sandbox>
+      </script>
+      <behavior>0</behavior>
+      <runForMatrixParent>false</runForMatrixParent>
+    </org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder>
+  </publishers>
+  <buildWrappers>
+    <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.33">
+      <deleteDirs>false</deleteDirs>
+      <cleanupParameter></cleanupParameter>
+      <externalDelete></externalDelete>
+    </hudson.plugins.ws__cleanup.PreBuildCleanup>
+  </buildWrappers>
+</project>
index c247012..d447d13 100644 (file)
@@ -198,6 +198,8 @@ fi
 %config %{destdir}/pre-release-request/config.xml
 %dir %{destdir}/ondemand_slave_control/
 %config %{destdir}/ondemand_slave_control/config.xml
+%dir %{destdir}/ondemand_slave_imager_checker/
+%config %{destdir}/ondemand_slave_imager_checker/config.xml
 %dir %{destdir}/update-gbs-meta/
 %config %{destdir}/update-gbs-meta/config.xml
 %dir %{destdir}/gbs-ref-fullbuild/