filtered-output #2
|
@ -54,7 +54,9 @@ pipeline {
|
|||
string(name: 'action_file',
|
||||
defaultValue: '',
|
||||
description: 'The relative path of the Bash fragment to execute.')
|
||||
|
||||
string(name: 'filter_with',
|
||||
defaultValue: '',
|
||||
description: 'If not empty, only actions including this filter in their output will be reported.')
|
||||
|
||||
}
|
||||
|
||||
|
@ -178,6 +180,7 @@ def exec(repo_url, repo_name) {
|
|||
output = sh(script: bashWrapper, returnStdout: true)?.trim()
|
||||
}
|
||||
}
|
||||
if ((!filter_with) || (filter_with && output.contains(filter_with))) {
|
||||
def xml_action = """
|
||||
<action repo="${repo_url}">
|
||||
<stdout>
|
||||
|
@ -186,7 +189,7 @@ def exec(repo_url, repo_name) {
|
|||
</action>
|
||||
"""
|
||||
sh "echo -e '${xml_action}' >> $ACTION_OUTPUT"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//a non CPS method is necessary for the usage of splitEachLine()
|
||||
|
|
Loading…
Reference in New Issue