Have jenkins update wait for queued builds, unable to catch pending though.

This commit is contained in:
libraryaddict 2020-07-05 13:19:43 +12:00
parent bfb496141e
commit 5a05dffdce

View File

@ -88,6 +88,22 @@ public class LDJenkins {
for (Map map : (List<Map>) lastBuild.get("builds")) { for (Map map : (List<Map>) lastBuild.get("builds")) {
String result = (String) map.get("result"); String result = (String) map.get("result");
if (result == null || result.equalsIgnoreCase("null")) {
if (version == null) {
DisguiseUtilities.getLogger()
.info("Jenkins build is pending.. Sleeping and checking again in 10 seconds");
try {
Thread.sleep(10000);
}
catch (InterruptedException e) {
e.printStackTrace();
}
return getLatestSnapshot();
}
}
Object items = ((Map) map.get("changeSet")).get("items"); Object items = ((Map) map.get("changeSet")).get("items");
boolean release = false; boolean release = false;