Skip to content

Commit

Permalink
Added timeout parameter and default project label
Browse files Browse the repository at this point in the history
  • Loading branch information
VermaSh committed Mar 29, 2018
1 parent 4f9a698 commit 01459bd
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Jenkins_jobs/WorkspaceInfo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ node {
stage('Print_Space_Monitoring_Data') {
NodeHelper nodeHelper = new NodeHelper();

String projectLabel = params.projectLabel;
String projectLabel;
if (params.projectLabel.length() > 1) {
projectLabel = params.projectLabel;
} else {
projectLabel = "all";
}

def currentInstance = Jenkins.getInstance();
Computer[] computers;
Expand All @@ -28,7 +33,8 @@ node {
if (computer.isOnline() && computer.getName() != "") {
String kernelName = nodeHelper.getOsKernelInfo(computer.getName()).get(0).toLowerCase()

if (nodeHelper.getLabels(computer.getName()).contains(projectLabel)) {
if (projectLabel.equals("all")
|| nodeHelper.getLabels(computer.getName()).contains(projectLabel)) {

String workspaceDirectory = nodeHelper.getHomeDirectoryPath(machineName);

Expand Down Expand Up @@ -154,4 +160,8 @@ def beautify(machineName, workspaceDirectory, workspaceStats, subdirectories) {
output += "\n=======================================================================\n\n";
}

parallel clones

timeout(time: params.timeout, unit: 'HOURS') {
parallel clones
}

0 comments on commit 01459bd

Please sign in to comment.