Email Extension Module - Cannot Get BUILD_LOG_EXCERPT to Work

Regardless of what I set to BUILD_LOG_EXCERPT, all I get is an email with an empty body, so you can use some help.

I have a Java program that writes to the console. The output from the Jenkins console is as follows:

...
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building project1 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- exec-maven-plugin:1.4.0:java (default-cli) @ project1 ---
Parameters provided: SG, 100, 1000
query: select COUNT(*) from table1 where col1 = ? and col2 = ? and col3 = ?
Rows in table: 5776
Threshold: 100
Rows returned above threshold, skipping dpan generation batch file.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.125 s
[INFO] Finished at: 2016-02-08T09:31:37-08:00
[INFO] Final Memory: 8M/245M
...

In a Jenkins job, I create a Post Build step and put the following line in the default content:

${BUILD_LOG_EXCERPT, start="\\b(Parameters)\\b", end="\\b(Threshold)\\b"}

When I start the task, all I get is an empty email. However, if I add

${BUILD_LOG, maxLines=9999, escapeHtml=false}

then I get the full console output in the letter. Any ideas? I am using version 2.40.3 of the plugin.

+4
source share
2

, , . , BUILD_LOG_EXCERPT java.util.regex.Pattern.Matcher.matches() - True, ( this SO question). , ( "" ).

, Parameters, ,

"\\b(Parameters)\\b(?s).*"

"" .

+4

BUILD_LOG_EXCERPT email-ext . , , , , , .

:

:

echo Start
<your build commands>
echo End

" " email-ext , :

${BUILD_LOG_EXCERPT, start="^Start", end="^End"}

html,

<pre>${BUILD_LOG_EXCERPT, start="^Start", end="^End"}</pre>

, , , .

+3

Source: https://habr.com/ru/post/1627834/


All Articles