Skip to content

Commit ed4ee7b

Browse files
committed
Add stage to run PLC container scanning
Signed-off-by: Yuanjing Xue <197832395+yuanjingx87@users.noreply.github.com>
1 parent 36982db commit ed4ee7b

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

jenkins/L0_MergeRequest.groovy

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,6 +1717,61 @@ def launchStages(pipeline, reuseBuild, testFilter, enableFailFast, globalVars)
17171717
echo "Build-Docker-Images job is set explicitly. Both x86_64-Linux and SBSA-Linux sub-pipelines will be disabled."
17181718
}
17191719

1720+
def plcContainerScanningJob = [
1721+
"PLC Container Scanning": {
1722+
script {
1723+
stage("[Build-Release-Docker-Images] Remote Run") {
1724+
try {
1725+
def branch = env.gitlabBranch ? env.gitlabBranch : "main"
1726+
if (globalVars[GITHUB_PR_API_URL]) {
1727+
branch = "github-pr-" + globalVars[GITHUB_PR_API_URL].split('/').last()
1728+
}
1729+
1730+
// Force the image tag suffix to be this L0_MergeRequest BUILD_NUMBER
1731+
// instead of the BuildDockerImages helper job's own counter.
1732+
def shortCommit = env.gitlabCommit ? env.gitlabCommit.substring(0, 7) : "undefined"
1733+
def branchTag = branch.replaceAll('/', '_')
1734+
def defaultTag = "${shortCommit}-${branchTag}-${env.BUILD_NUMBER}"
1735+
1736+
def additionalParameters = [
1737+
'branch': branch,
1738+
'action': "push",
1739+
'triggerType': env.JOB_NAME ==~ /.*PostMerge.*/ ? "post-merge" : "pre-merge",
1740+
'runSanityCheck': false,
1741+
'defaultTag': defaultTag,
1742+
'buildInternalRelease': false,
1743+
'buildCiImage': false,
1744+
'artifactPath': ARTIFACT_PATH,
1745+
'uploadPath': UPLOAD_PATH
1746+
]
1747+
1748+
// For test, revert this to trigger downstream in LLM/helpers before merging
1749+
//
1750+
//launchJob(pipeline, "/LLM/helpers/BuildDockerImages", false, enableFailFast, globalVars, "x86_64", additionalParameters)
1751+
launchJob(pipeline, "/LLM/dev-yuanjingx/BuildDockerImages", false, enableFailFast, globalVars, "x86_64", additionalParameters)
1752+
} catch (InterruptedException e) {
1753+
throw e
1754+
} catch (Exception e) {
1755+
if (BUILD_CHECK_CHOICE == STAGE_CHOICE_IGNORE) {
1756+
catchError(
1757+
buildResult: 'SUCCESS',
1758+
stageResult: 'FAILURE') {
1759+
error "Build-Docker-Images job failed but ignored due to Jenkins configuration"
1760+
}
1761+
} else {
1762+
throw e
1763+
}
1764+
}
1765+
}
1766+
}
1767+
}
1768+
]
1769+
if (testFilter[(TEST_STAGE_LIST)]?.contains("NGC-Container-Scaning")) {
1770+
stages += plcContainerScanningJob
1771+
testFilter[(TEST_STAGE_LIST)]?.remove("NGC-Container-Scanning")
1772+
echo "Will run job to build ngc containers and running in-pipeline scanning for them"
1773+
}
1774+
17201775
parallelJobs = stages.collectEntries{key, value -> [key, {
17211776
script {
17221777
stage(key) {

0 commit comments

Comments
 (0)