feat(pipeline): enhance ChangedComponentsDetector logging and refine conditional execution for component stages
Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
parent
5501e060f8
commit
6df9ace1d7
@ -16,6 +16,8 @@ class ChangedComponentsDetector {
|
|||||||
def changedFiles = steps.sh(script: 'git diff --name-only HEAD~1 HEAD', returnStdout: true)
|
def changedFiles = steps.sh(script: 'git diff --name-only HEAD~1 HEAD', returnStdout: true)
|
||||||
.trim()
|
.trim()
|
||||||
.split('\n')
|
.split('\n')
|
||||||
|
|
||||||
|
steps.log.info("ChangedComponentsDetector", "Changed files: ${changedFiles}")
|
||||||
|
|
||||||
changedFiles.each { file ->
|
changedFiles.each { file ->
|
||||||
components.each { component ->
|
components.each { component ->
|
||||||
|
|||||||
@ -736,11 +736,21 @@ spec:
|
|||||||
stage("Pipeline :: Components Build (Dynamic Generated Stages)") {
|
stage("Pipeline :: Components Build (Dynamic Generated Stages)") {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
if (env.executeMode == "fully" || env.changedComponents.split(/\s+/).toList().size() > 0) {
|
if (env.executeMode == "fully") {
|
||||||
configurations.components.each { component ->
|
configurations.components.each { component ->
|
||||||
log.info("Pipeline", "Executing generated stages for ${component.name}...")
|
log.info("Pipeline", "Executing generated stages for ${component.name}...")
|
||||||
generateComponentStages(component, configurations)()
|
generateComponentStages(component, configurations)()
|
||||||
}
|
}
|
||||||
|
} else if {
|
||||||
|
def changedComponents = env.changedComponents.split(/\s+/).toList()
|
||||||
|
configurations.components.each { component ->
|
||||||
|
if (changedComponents.contains(component.name)) {
|
||||||
|
log.info("Pipeline", "Executing generated stages for ${component.name}...")
|
||||||
|
generateComponentStages(component, configurations)()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.info("Pipeline", "No components changed, skipping...")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user