Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .ci-orchestrator/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
type: pipeline_definition
product: Liberty
name: CiCommon
description: Run a Pipeline for ci.common using Cognitive Software Delivery infrastructure

triggers:
- type: manual
triggerName: "Manual"
description: "Runs a ci.common Pipeline, building and testing the PR - Manual Trigger"
triggerRank: 50
groups: ["CommonComponents"]
- type: github
triggerName: "GitHub"
description: "Runs a ci.common Pipeline, building and testing the PR - Github Trigger"
triggerRank: 50
groups: ["CommonComponents"]
keyword: "!build"
aliasKeywords:
- "#build"

steps:
- stepGroup: Build ci.common Dependency
includeSteps:
- file: steps/buildCiCommonDependency.yml
- stepGroup: Build ci.common
includeSteps:
- file: steps/buildCiCommon.yml
10 changes: 10 additions & 0 deletions .ci-orchestrator/steps/buildCiCommon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- stepName: "CiCommonBuild"
coreStep: true
workType: Jenkins
projectName: CiCommonBuild
timeoutInMinutes: 30
dependsOn:
- stepName: CiCommonDependencyBuild
awaitOutputProperties: true
properties:
jenkinsServiceName: "websphere-extra-jenkins"
7 changes: 7 additions & 0 deletions .ci-orchestrator/steps/buildCiCommonDependency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- stepName: "CiCommonDependencyBuild"
coreStep: true
workType: Jenkins
projectName: CiCommonDependencyBuild
timeoutInMinutes: 30
properties:
jenkinsServiceName: "websphere-extra-jenkins"
38 changes: 38 additions & 0 deletions jenkins/build.jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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_branch', defaultValue: "main", description: 'Git branch to check out of repo. If the branch does not exist, main is used instead.')
])
])
timestamps {
library 'jenkins-ci-websphere'
if (shouldSkipDueToSeedJob()) {
return;
}

try {
onEBC(
demandId: params.executionId,
ebcPlan: params.ebcPlan,
ebcShortlist: params.ebcShortlist,
autoCompleteAfterXHours: 24) {
buildName params.executionId
stage("Running Job") {
reportActivity(name: "ci.common PR Build", executionId: params.executionId) {
sh "git clone --branch ${params.github_pr_branch} --depth 1 https://github.com/OpenLiberty/ci.common.git ci.common"
withEnv([
"executionId=${params.executionId}"
]) {
sh "ci.common/scripts/build.sh"
}
}
}
}
} finally {
onLocal() {
cleanupWorkspace()
}
}
}
38 changes: 38 additions & 0 deletions jenkins/buildDependency.jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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_branch', defaultValue: "main", description: 'Git branch to check out of repo. If the branch does not exist, main is used instead.')
])
])
timestamps {
library 'jenkins-ci-websphere'
if (shouldSkipDueToSeedJob()) {
return;
}

try {
onEBC(
demandId: params.executionId,
ebcPlan: params.ebcPlan,
ebcShortlist: params.ebcShortlist,
autoCompleteAfterXHours: 24) {
buildName params.executionId
stage("Running Job") {
reportActivity(name: "ci.common Dependency Build", executionId: params.executionId) {
sh "git clone --branch ${params.github_pr_branch} --depth 1 https://github.com/OpenLiberty/ci.common.git ci.common"
withEnv([
"executionId=${params.executionId}"
]) {
sh "ci.common/scripts/buildDependency.sh"
}
}
}
}
} finally {
onLocal() {
cleanupWorkspace()
}
}
}
20 changes: 20 additions & 0 deletions jenkins/jobs/build.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pipelineJob("CiCommonBuild") {
description("Builds ci.common.")
keepDependencies(false)
definition {
cpsScm {
scm {
git("https://github.com/OpenLiberty/ci.common.git", "main")
}
scriptPath("jenkins/build.jenkinsfile")
lightweight()
}
}
disabled(false)
configure {
it / 'properties' / 'com.sonyericsson.rebuild.RebuildSettings' {
'autoRebuild'('false')
'rebuildDisabled'('false')
}
}
}
20 changes: 20 additions & 0 deletions jenkins/jobs/buildDependency.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pipelineJob("CiCommonDependencyBuild") {
description("Builds ci.common dependency.")
keepDependencies(false)
definition {
cpsScm {
scm {
git("https://github.com/OpenLiberty/ci.common.git", "main")
}
scriptPath("jenkins/buildDependency.jenkinsfile")
lightweight()
}
}
disabled(false)
configure {
it / 'properties' / 'com.sonyericsson.rebuild.RebuildSettings' {
'autoRebuild'('false')
'rebuildDisabled'('false')
}
}
}
3 changes: 3 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
echo "=== ci.common build.sh ==="
echo "executionId: ${executionId}"
3 changes: 3 additions & 0 deletions scripts/buildDependency.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
echo "=== ci.common buildDependency.sh ==="
echo "executionId: ${executionId}"
Loading