fix(pipeline): update environment variable naming for component-specific images in stage generation
Signed-off-by: 孙振宇 <>
This commit is contained in:
parent
ef9c74a43e
commit
36f4604e6a
@ -38,7 +38,7 @@ def generateComponentStages(component, configurations) {
|
||||
}
|
||||
}
|
||||
log.info("Pipeline", "Using ${buildAgentImage} as build agent image for ${component.name}")
|
||||
env.buildAgentImage = buildAgentImage
|
||||
env."${component.name}_buildAgentImage" = buildAgentImage
|
||||
}
|
||||
}
|
||||
}},
|
||||
@ -49,7 +49,7 @@ def generateComponentStages(component, configurations) {
|
||||
containers: [
|
||||
containerTemplate(
|
||||
name: 'dep-resolver',
|
||||
image: env.buildAgentImage,
|
||||
image: env."${component.name}_buildAgentImage",
|
||||
ttyEnabled: true,
|
||||
command: 'sleep',
|
||||
args: 'infinity'
|
||||
@ -60,7 +60,8 @@ def generateComponentStages(component, configurations) {
|
||||
container('dep-resolver') {
|
||||
script {
|
||||
if (env.executeMode == "fully" || env.changedComponents.contains(component.name)) {
|
||||
log.info("Pipeline", "Using ${env.buildAgentImage} as build agent image for dependencies resolving")
|
||||
def buildAgentImage = env."${component.name}_buildAgentImage"
|
||||
log.info("Pipeline", "Using ${buildAgentImage} as build agent image for dependencies resolving")
|
||||
def sourceFetcher = new SourceFetcher(this)
|
||||
sourceFetcher.fetch(configurations)
|
||||
|
||||
@ -109,7 +110,7 @@ def generateComponentStages(component, configurations) {
|
||||
}
|
||||
|
||||
log.info("Pipeline", "Using ${linter.linter} with image ${linter.containerImage} as linter for ${component.name}")
|
||||
env.linterContainerImage = linter.containerImage
|
||||
env."${component.name}_linterContainerImage" = linter.containerImage
|
||||
} else {
|
||||
log.info("Pipeline", "Code linting is not enabled for ${component.name}, skipping...")
|
||||
}
|
||||
@ -123,7 +124,7 @@ def generateComponentStages(component, configurations) {
|
||||
containers: [
|
||||
containerTemplate(
|
||||
name: 'code-linter',
|
||||
image: env.linterContainerImage,
|
||||
image: env."${component.name}_linterContainerImage",
|
||||
ttyEnabled: true,
|
||||
command: 'sleep',
|
||||
args: 'infinity'
|
||||
@ -190,7 +191,7 @@ def generateComponentStages(component, configurations) {
|
||||
log.error("Pipeline", "SAST scanner ${sastScannerType.scanner} is not supported for ${component.language}, skipping SAST scanning")
|
||||
} else {
|
||||
log.info("Pipeline", "Using ${sastScanner} as SAST scanner for ${component.name}")
|
||||
env.sastScannerContainerImage = sastScannerType.containerImage
|
||||
env."${component.name}_sastScannerContainerImage" = sastScannerType.containerImage
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -208,7 +209,7 @@ def generateComponentStages(component, configurations) {
|
||||
containers: [
|
||||
containerTemplate(
|
||||
name: 'sast-scanner',
|
||||
image: env.sastScannerContainerImage,
|
||||
image: env."${component.name}_sastScannerContainerImage",
|
||||
ttyEnabled: true,
|
||||
command: 'sleep',
|
||||
args: 'infinity'
|
||||
@ -285,7 +286,7 @@ def generateComponentStages(component, configurations) {
|
||||
containers: [
|
||||
containerTemplate(
|
||||
name: 'build-agent',
|
||||
image: env.buildAgentImage,
|
||||
image: env."${component.name}_buildAgentImage",
|
||||
ttyEnabled: true,
|
||||
command: 'sleep',
|
||||
args: 'infinity'
|
||||
@ -296,7 +297,8 @@ def generateComponentStages(component, configurations) {
|
||||
container('build-agent') {
|
||||
script {
|
||||
if (env.executeMode == "fully" || env.changedComponents.contains(component.name)) {
|
||||
log.info("Pipeline", "Using ${env.buildAgentImage} as build agent image for compilation & packaging")
|
||||
def buildAgentImage = env."${component.name}_buildAgentImage"
|
||||
log.info("Pipeline", "Using ${buildAgentImage} as build agent image for compilation & packaging")
|
||||
|
||||
def sourceFetcher = new SourceFetcher(this)
|
||||
sourceFetcher.fetch(configurations)
|
||||
@ -366,7 +368,7 @@ def generateComponentStages(component, configurations) {
|
||||
}
|
||||
}
|
||||
|
||||
env.imageBuilderImage = imageBuilder.image
|
||||
env."${component.name}_imageBuilderImage" = imageBuilder.image
|
||||
log.info("Pipeline", "Using ${imageBuilder.builder} (image: ${imageBuilder.image}) as image builder for ${component.name}")
|
||||
}
|
||||
}
|
||||
@ -378,7 +380,7 @@ def generateComponentStages(component, configurations) {
|
||||
containers: [
|
||||
containerTemplate(
|
||||
name: 'image-builder',
|
||||
image: env.imageBuilderImage,
|
||||
image: env."${component.name}_imageBuilderImage",
|
||||
privileged: true,
|
||||
ttyEnabled: true,
|
||||
command: 'sleep',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user