Skip to content

Commit

Permalink
Actually working
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdgriffin committed Mar 24, 2017
1 parent 8b324b6 commit f76004e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
5 changes: 3 additions & 2 deletions bootstrap/Platform_Management/Load_Cartridge_List.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ def platformManagementFolderName= "/Platform_Management"
def platformManagementFolder = folder(platformManagementFolderName) { displayName('Platform Management') }

def adopPlatformManagementVersion = (binding.variables.containsKey("ADOP_PLATFORM_MANAGEMENT_VERSION")) ? "${ADOP_PLATFORM_MANAGEMENT_VERSION}".toString() : '';
def adopPlatformManagementVersionRef = '${ADOP_PLATFORM_MANAGEMENT_VERSION}';

if (!adopPlatformManagementVersion.matches("[a-fA-F0-9]{8,40}")) {
out.println("[WARN] ADOP_PLATFORM_MANAGEMENT_VERSION is set to '" + adopPlatformManagementVersion + "' which is not a valid hash - defaulting to '*/master'")
adopPlatformManagementVersion = '*/master';
adopPlatformManagementVersionRef = '*/master';
}

// Jobs
Expand Down Expand Up @@ -73,7 +74,7 @@ done < ${WORKSPACE}/platform-management/cartridges.txt''')
url("${platformToolsGitURL}")
credentials("adop-jenkins-master")
}
branch(adopPlatformManagementVersion)
branch(adopPlatformManagementVersionRef)
relativeTargetDir('platform-management')
}
}
Expand Down
5 changes: 3 additions & 2 deletions bootstrap/Platform_Management/Setup_Gerrit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ def platformManagementFolderName= "/Platform_Management"
def platformManagementFolder = folder(platformManagementFolderName) { displayName('Platform Management') }

def adopPlatformManagementVersion = (binding.variables.containsKey("ADOP_PLATFORM_MANAGEMENT_VERSION")) ? "${ADOP_PLATFORM_MANAGEMENT_VERSION}".toString() : '';
def adopPlatformManagementVersionRef = '${ADOP_PLATFORM_MANAGEMENT_VERSION}';

if (!adopPlatformManagementVersion.matches("[a-fA-F0-9]{8,40}")) {
out.println("[WARN] ADOP_PLATFORM_MANAGEMENT_VERSION is set to '" + adopPlatformManagementVersion + "' which is not a valid hash - defaulting to '*/master'")
adopPlatformManagementVersion = '*/master';
adopPlatformManagementVersionRef = '*/master';
}

// Jobs
Expand Down Expand Up @@ -60,7 +61,7 @@ fi''')
url("${platformToolsGitURL}")
credentials("adop-jenkins-master")
}
branch(adopPlatformManagementVersion)
branch(adopPlatformManagementVersionRef)
relativeTargetDir('platform-management')
}
}
Expand Down
5 changes: 3 additions & 2 deletions bootstrap/Workspace_Management/Generate_Workspace.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ def workspaceManagementFolderName= "/Workspace_Management"
def workspaceManagementFolder = folder(workspaceManagementFolderName) { displayName('Workspace Management') }

def adopPlatformManagementVersion = (binding.variables.containsKey("ADOP_PLATFORM_MANAGEMENT_VERSION")) ? "${ADOP_PLATFORM_MANAGEMENT_VERSION}".toString() : '';
def adopPlatformManagementVersionRef = '${ADOP_PLATFORM_MANAGEMENT_VERSION}';

if (!adopPlatformManagementVersion.matches("[a-fA-F0-9]{8,40}")) {
out.println("[WARN] ADOP_PLATFORM_MANAGEMENT_VERSION is set to '" + adopPlatformManagementVersion + "' which is not a valid hash - defaulting to '*/master'")
adopPlatformManagementVersion = '*/master';
adopPlatformManagementVersionRef = '*/master';
}

// Jobs
Expand Down Expand Up @@ -79,7 +80,7 @@ done''')
url("${platformToolsGitURL}")
credentials("adop-jenkins-master")
}
branch(adopPlatformManagementVersion)
branch(adopPlatformManagementVersionRef)
}
}
}
5 changes: 3 additions & 2 deletions projects/jobs/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ def cartridgeBaseUrl = gerritBaseUrl + "/cartridges"
def platformToolsGitUrl = gerritBaseUrl + "/platform-management"

def adopPlatformManagementVersion = (binding.variables.containsKey("ADOP_PLATFORM_MANAGEMENT_VERSION")) ? "${ADOP_PLATFORM_MANAGEMENT_VERSION}".toString() : '';
def adopPlatformManagementVersionRef = '${ADOP_PLATFORM_MANAGEMENT_VERSION}';

if (!adopPlatformManagementVersion.matches("[a-fA-F0-9]{8,40}")) {
out.println("[WARN] ADOP_PLATFORM_MANAGEMENT_VERSION is set to '" + adopPlatformManagementVersion + "' which is not a valid hash - defaulting to '*/master'")
adopPlatformManagementVersion = '*/master';
adopPlatformManagementVersionRef = '*/master';
}

// Folders
Expand Down Expand Up @@ -425,7 +426,7 @@ def cartridgeFolder = folder(cartridgeFolderName) {
url("${platformToolsGitUrl}")
credentials("adop-jenkins-master")
}
branch(adopPlatformManagementVersion)
branch(adopPlatformManagementVersionRef)
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions workspaces/jobs/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
def platformToolsGitURL = "ssh://jenkins@gerrit:29418/platform-management"

def adopPlatformManagementVersion = (binding.variables.containsKey("ADOP_PLATFORM_MANAGEMENT_VERSION")) ? "${ADOP_PLATFORM_MANAGEMENT_VERSION}".toString() : '';
def adopPlatformManagementVersionRef = '${ADOP_PLATFORM_MANAGEMENT_VERSION}';

if (!adopPlatformManagementVersion.matches("[a-fA-F0-9]{8,40}")) {
out.println("[WARN] ADOP_PLATFORM_MANAGEMENT_VERSION is set to '" + adopPlatformManagementVersion + "' which is not a valid hash - defaulting to '*/master'")
adopPlatformManagementVersion = '*/master';
adopPlatformManagementVersionRef = '*/master';
}

// Folders
Expand Down Expand Up @@ -94,7 +95,7 @@ source ${WORKSPACE}/projects/gerrit/configure.sh -r permissions-with-review''')
url("${platformToolsGitURL}")
credentials("adop-jenkins-master")
}
branch(adopPlatformManagementVersion)
branch(adopPlatformManagementVersionRef)
}
}
}

0 comments on commit f76004e

Please sign in to comment.