Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
780 views
in Technique[技术] by (71.8m points)

jenkins - How can I take last 20 lines from the $BUILD_LOG variable?

When using Email-ext plugin, I would like also to write the last 20 lines of the build log there (not attached as a file) I know I can access the log using $BUILD_LOG variable, but don't know exactly how to take the las 20 lines from that variable. Any help? Thanks a lot.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You could use the following syntax, from the Content Token reference:

${BUILD_LOG, maxLines, escapeHtml} - Displays the end of the build log. maxLines - display at most this many lines of the log. Defaults to 250. escapeHtml - If true, HTML is escaped. Defaults to false.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...