问题
Has anyone managed to get Jenkins Naginator plugin working with the use of a regex?
I have the console output
Build was aborted
Aborted by xxxxxxxxx
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at BUILD level C:\xxxxxxxxx\workspace\testSuiteExecution\target\surefire-reports to /var/lib/jenkins/jobs/testSuiteExecution/builds/534/htmlreports/HTML_Report
ERROR: Specified HTML directory 'C:\xxxxxx\workspace\testSuiteExecution\target\surefire-reports' does not exist.
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Notifying upstream projects of job completion
Finished: ABORTED
I use the naginator plugin to rebuild previous build only if the it was aborted. Therefore I put :
But this isn't working. I tried many regex variations (eg Build was aborted), but with no luck. Has anyone managed to get it working?
Do you have any alternatives to re-run only an aborted build (not failed, or successful, or unstable)
回答1:
Just skip the slashes. the "regex" should be in this case:
Build was aborted
You can add an OR condition with
||
Just as an example:
ERROR: Error fetching remote repo 'origin' || .OutOfMemoryError
回答2:
Syntax was changed. Currently correct is:
first phrase|any second phrase|third text
Important point: absence of spaces near symbol "|".
This example:
first phrase | any text
means search for occurrence of "first phrase " or " any text".
Also I didn't find proper syntax for wildcards with "*" after huge amount of experiments, so it doesn't behave as regular expressions.
来源:https://stackoverflow.com/questions/41466219/jenkins-naginator-plugin-and-regex