jjb: lttng-modules: Add riscv64 to crossbuilds
[lttng-ci.git] / scripts / system-tests / system-trigger.groovy
index fd5b901cedd095e1bee178077128e243baaf021f..6b1028d2a4cd07b1189c04a73f16ed252e5fbc31 100644 (file)
@@ -269,6 +269,10 @@ def CraftJobName = { jobType, linuxBranch, lttngBranch ->
 
 def LaunchJob = { jobName, jobInfo ->
   def job = Hudson.instance.getJob(jobName)
+  if (job == null) {
+    println(String.format("Failed to find job by name '%s'", jobName))
+    return null;
+  }
   def params = []
   for (paramdef in job.getProperty(ParametersDefinitionProperty.class).getParameterDefinitions()) {
     // If there is a default value for this parameter, use it. Don't use empty
@@ -437,7 +441,21 @@ currentJobs.each { jobName, jobInfo ->
 
   jobInfo['status'] = 'PENDING';
   jobInfo['build'] = LaunchJob(jobName, jobInfo);
-  ongoingJobs += 1;
+  if (jobInfo['build'] != null) {
+    ongoingJobs += 1;
+  }
+}
+
+// Some jobs may have a null build immediately if LaunchJob
+// failed for some reason, those jobs can immediately be removed.
+def jobKeys = currentJobs.collect { jobName, jobInfo ->
+    return jobName;
+}
+jobKeys.each { k ->
+  if (currentJobs.get(k)['build'] == null) {
+    println(String.format("Removing job '%s' since build is null", k));
+    currentJobs.remove(k);
+  }
 }
 
 while (ongoingJobs > 0) {
This page took 0.028077 seconds and 4 git commands to generate.