Get text from file and display in Jenkins email content
Asked Answered
J

2

0

I have constructed Build version from a config file and saved this version number value to a file which resides in my workspace. The contents of this file will contain values like 2014.4.3.87

Now, I need to get this value on to the Jenkins e-mail body. I have email ext plugin installed. How do i do it.

Jacobean answered 13/2, 2015 at 7:51 Comment(0)
B
2

You can use a shell command echo the file content and save it into a into a another file, like content="real content"

For example:

fileContent="content=$(echo filepath)"

You can use env inject plugin to inject this file "filecontent" as env.

Then inside the email ext plugin, try use this to read it ${ENV, var="content"} in the file content text area

Bewail answered 13/2, 2015 at 8:1 Comment(0)
M
3

In Post-build actions - Editable Email Notification

  1. Ensure Content Type is set to html.
  2. In Default Content add ${FILE,path="workspace_relative_filepath"}.
Mon answered 27/10, 2017 at 6:33 Comment(0)
B
2

You can use a shell command echo the file content and save it into a into a another file, like content="real content"

For example:

fileContent="content=$(echo filepath)"

You can use env inject plugin to inject this file "filecontent" as env.

Then inside the email ext plugin, try use this to read it ${ENV, var="content"} in the file content text area

Bewail answered 13/2, 2015 at 8:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.