Skip to content

Commit

Permalink
Merge pull request #11 from nickdgriffin/master
Browse files Browse the repository at this point in the history
Fixing platform jobs to a set version of adop-platform-management
  • Loading branch information
RobertNorthard authored May 10, 2018
2 parents d2bd6c4 + 6f0e1aa commit 53db750
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 5 deletions.
10 changes: 9 additions & 1 deletion bootstrap/Platform_Management/Load_Cartridge_List.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ def platformToolsGitURL = "ssh://jenkins@gerrit:29418/platform-management"
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'")
adopPlatformManagementVersionRef = '*/master';
}

// Jobs
def loadCartridgeJob = freeStyleJob(platformManagementFolderName + "/Load_Cartridge_List")

Expand Down Expand Up @@ -66,7 +74,7 @@ done < ${WORKSPACE}/platform-management/cartridges.txt''')
url("${platformToolsGitURL}")
credentials("adop-jenkins-master")
}
branch("*/master")
branch(adopPlatformManagementVersionRef)
relativeTargetDir('platform-management')
}
}
Expand Down
10 changes: 9 additions & 1 deletion bootstrap/Platform_Management/Setup_Gerrit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ def platformToolsGitURL = "ssh://jenkins@gerrit:29418/platform-management"
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'")
adopPlatformManagementVersionRef = '*/master';
}

// Jobs
def setupGerritJob = freeStyleJob(platformManagementFolderName + "/Setup_Gerrit")

Expand Down Expand Up @@ -53,7 +61,7 @@ fi''')
url("${platformToolsGitURL}")
credentials("adop-jenkins-master")
}
branch("*/master")
branch(adopPlatformManagementVersionRef)
relativeTargetDir('platform-management')
}
}
Expand Down
10 changes: 9 additions & 1 deletion bootstrap/Workspace_Management/Generate_Workspace.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ def platformToolsGitURL = "ssh://jenkins@gerrit:29418/platform-management"
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'")
adopPlatformManagementVersionRef = '*/master';
}

// Jobs
def generateWorkspaceJob = freeStyleJob(workspaceManagementFolderName + "/Generate_Workspace")

Expand Down Expand Up @@ -72,7 +80,7 @@ done''')
url("${platformToolsGitURL}")
credentials("adop-jenkins-master")
}
branch("*/master")
branch(adopPlatformManagementVersionRef)
}
}
}
10 changes: 9 additions & 1 deletion projects/jobs/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ def gerritBaseUrl = "ssh://jenkins@gerrit:29418"
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'")
adopPlatformManagementVersionRef = '*/master';
}

// Folders
def workspaceFolderName = "${WORKSPACE_NAME}"

Expand Down Expand Up @@ -418,7 +426,7 @@ def cartridgeFolder = folder(cartridgeFolderName) {
url("${platformToolsGitUrl}")
credentials("adop-jenkins-master")
}
branch("*/master")
branch(adopPlatformManagementVersionRef)
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion workspaces/jobs/jobs.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
// Constants
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'")
adopPlatformManagementVersionRef = '*/master';
}

// Folders
def workspaceFolderName = "${WORKSPACE_NAME}"
def workspaceFolder = folder(workspaceFolderName)
Expand Down Expand Up @@ -87,7 +95,7 @@ source ${WORKSPACE}/projects/gerrit/configure.sh -r permissions-with-review''')
url("${platformToolsGitURL}")
credentials("adop-jenkins-master")
}
branch("*/master")
branch(adopPlatformManagementVersionRef)
}
}
}

0 comments on commit 53db750

Please sign in to comment.