diff --git a/.ci-orchestrator/open-liberty-ci-ant-build.yml b/.ci-orchestrator/open-liberty-ci-ant-build.yml index 592a69f..ae115b9 100644 --- a/.ci-orchestrator/open-liberty-ci-ant-build.yml +++ b/.ci-orchestrator/open-liberty-ci-ant-build.yml @@ -9,6 +9,13 @@ triggers: description: "Runs an Open Liberty CI Ant Pipeline, building and testing the PR - Manual Trigger" triggerRank: 50 groups: ["WebsphereCommonComponents"] + propertyDefinitions: + - name: repoSHA + description: "The Full Commit Sha you wish to build" + required: true + - name: repoUser + description: "The GitHub user/fork owner (e.g. OpenLiberty or contributor)" + defaultValue: "OpenLiberty" - type: github triggerName: "GitHub" description: "Runs an Open Liberty CI Ant, building and testing the PR - Github Trigger" @@ -17,6 +24,14 @@ triggers: keyword: "!build" aliasKeywords: - "#build" + propertyDefinitions: + - name: repoSHA + defaultValue: "${github_pr_sha}" + description: "The Full Commit Sha you wish to build" + required: true + - name: repoUser + defaultValue: "${github_pr_user}" + description: "The GitHub user/fork owner" steps: - stepGroup: Build Open Liberty CI Ant dependency diff --git a/.ci-orchestrator/steps/OpenLibertyCIAntBuild.yml b/.ci-orchestrator/steps/OpenLibertyCIAntBuild.yml index 1d886d2..e68f8f7 100644 --- a/.ci-orchestrator/steps/OpenLibertyCIAntBuild.yml +++ b/.ci-orchestrator/steps/OpenLibertyCIAntBuild.yml @@ -1,10 +1,8 @@ - stepName: "OpenLibertyCIAntBuild" - coreStep: true workType: Jenkins projectName: OpenLibertyCIAntBuild - timeoutInMinutes: 30 + timeoutInMinutes: 720 dependsOn: - stepName: OpenLibertyCIAntDependencyBuild - awaitOutputProperties: true properties: jenkinsServiceName: "websphere-extra-jenkins" diff --git a/.ci-orchestrator/steps/OpenLibertyCIAntDependencyBuild.yml b/.ci-orchestrator/steps/OpenLibertyCIAntDependencyBuild.yml index 6631fc4..a923125 100644 --- a/.ci-orchestrator/steps/OpenLibertyCIAntDependencyBuild.yml +++ b/.ci-orchestrator/steps/OpenLibertyCIAntDependencyBuild.yml @@ -1,7 +1,6 @@ - stepName: "OpenLibertyCIAntDependencyBuild" - coreStep: true workType: Jenkins projectName: OpenLibertyCIAntDependencyBuild - timeoutInMinutes: 30 + timeoutInMinutes: 720 properties: - jenkinsServiceName: "websphere-extra-jenkins" \ No newline at end of file + jenkinsServiceName: "websphere-extra-jenkins" diff --git a/jenkins/open-liberty-ci-ant-build-dependency.jenkinsfile b/jenkins/open-liberty-ci-ant-build-dependency.jenkinsfile index 89eae84..9336bc9 100644 --- a/jenkins/open-liberty-ci-ant-build-dependency.jenkinsfile +++ b/jenkins/open-liberty-ci-ant-build-dependency.jenkinsfile @@ -1,9 +1,11 @@ properties([ parameters([ - string(name: 'executionId', defaultValue: UUID.randomUUID().toString(), description: 'Unique execution id.'), - string(name: 'ebcPlan', defaultValue: 'See Shortlist', description: 'EBC plan to use when provisioning a Jenkins node (ignored when shortlist is supplied).'), - string(name: 'ebcShortlist', defaultValue: 'jenkins-child.yml', description: 'Overrides the ebcPlan. This controls the EBC shortlist to use when provisioning a Jenkins node.'), - string(name: 'github_pr_sha', defaultValue: '', description: 'Head commit SHA of the PR being tested.'), + string(name: 'executionId', defaultValue: UUID.randomUUID().toString(), description: 'Unique execution id.'), + string(name: 'ebcPlan', defaultValue: 'See Shortlist', description: 'EBC plan to use when provisioning a Jenkins node. Ignored when shortlist is supplied.'), + string(name: 'ebcShortlist', defaultValue: 'jenkins-child.yml', description: 'Overrides the ebcPlan. This controls the EBC shortlist to use when provisioning a Jenkins node.'), + string(name: 'ebcPriority', defaultValue: '90', description: 'Priority of the build execution on EBC.'), + string(name: 'repoUser', defaultValue: 'OpenLiberty', description: 'GitHub user or org holding the repository/fork.'), + string(name: 'repoSHA', defaultValue: '', description: 'Head commit SHA of the PR being tested.'), string(name: 'ecosystemTracking', defaultValue: '"productArea":"Liberty"', description: 'Tracking Map as string often containing information about what CI Orchestrator pipeline.') ]) ]) @@ -16,23 +18,24 @@ timestamps { try { onEBC( demandId: params.executionId, - ebcPlan: params.ebcPlan, ebcShortlist: params.ebcShortlist, + priority: params.ebcPriority, autoCompleteAfterXHours: 24) { buildName params.executionId stage("Running Job") { reportActivity(name: "Build Open Liberty CI Ant dependency", executionId: params.executionId) { - sh """ - git init ci.ant - cd ci.ant - git remote add origin https://github.com/OpenLiberty/ci.ant.git - git fetch --depth 1 origin ${params.github_pr_sha} - git checkout --detach FETCH_HEAD - """ - withEnv([ - "executionId=${params.executionId}" - ]) { - sh "ci.ant/scripts/buildDependency.sh" + dir('ci.ant') { + sh """ + git init + git remote add origin git@github.com:${params.repoUser}/ci.ant.git + git fetch --depth 1 origin ${params.repoSHA} + git checkout --detach FETCH_HEAD + """ + withEnv([ + "executionId=${params.executionId}" + ]) { + sh "./scripts/buildDependency.sh" + } } } } diff --git a/jenkins/open-liberty-ci-ant-build.jenkinsfile b/jenkins/open-liberty-ci-ant-build.jenkinsfile index 4368f61..7e985eb 100644 --- a/jenkins/open-liberty-ci-ant-build.jenkinsfile +++ b/jenkins/open-liberty-ci-ant-build.jenkinsfile @@ -1,9 +1,11 @@ properties([ parameters([ string(name: 'executionId', defaultValue: UUID.randomUUID().toString(), description: 'Unique execution id.'), - string(name: 'ebcPlan', defaultValue: 'See Shortlist', description: 'EBC plan to use when provisioning a Jenkins node (ignored when shortlist is supplied).'), - string(name: 'ebcShortlist', defaultValue: 'jenkins-child.yml', description: 'Overrides the ebcPlan. This controls the EBC shortlist to use when provisioning a Jenkins node.'), - string(name: 'github_pr_sha', defaultValue: '', description: 'Head commit SHA of the PR being tested.'), + string(name: 'ebcPlan', defaultValue: 'See Shortlist', description: 'EBC plan to use when provisioning a Jenkins node. Ignored when shortlist is supplied.'), + string(name: 'ebcShortlist', defaultValue: 'jenkins-child.yml', description: 'Overrides the ebcPlan. This controls the EBC shortlist to use when provisioning a Jenkins node.'), + string(name: 'ebcPriority', defaultValue: '90', description: 'Priority of the build execution on EBC.'), + string(name: 'repoUser', defaultValue: 'OpenLiberty', description: 'GitHub user or org holding the repository/fork.'), + string(name: 'repoSHA', defaultValue: '', description: 'Head commit SHA of the PR being tested.'), string(name: 'ecosystemTracking', defaultValue: '"productArea":"Liberty"', description: 'Tracking Map as string often containing information about what CI Orchestrator pipeline.') ]) ]) @@ -16,23 +18,24 @@ timestamps { try { onEBC( demandId: params.executionId, - ebcPlan: params.ebcPlan, ebcShortlist: params.ebcShortlist, + priority: params.ebcPriority, autoCompleteAfterXHours: 24) { buildName params.executionId stage("Running Job") { reportActivity(name: "Build Open Liberty CI Ant", executionId: params.executionId) { - sh """ - git init ci.ant - cd ci.ant - git remote add origin https://github.com/OpenLiberty/ci.ant.git - git fetch --depth 1 origin ${params.github_pr_sha} - git checkout --detach FETCH_HEAD - """ - withEnv([ - "executionId=${params.executionId}" - ]) { - sh "ci.ant/scripts/build.sh" + dir('ci.ant') { + sh """ + git init + git remote add origin git@github.com:${params.repoUser}/ci.ant.git + git fetch --depth 1 origin ${params.repoSHA} + git checkout --detach FETCH_HEAD + """ + withEnv([ + "executionId=${params.executionId}" + ]) { + sh "./scripts/build.sh" + } } } }