1

I have a Python script that sets value of a variable var and prints it.

As soon as the script completes execution, I need to get the value of the variable var and send it as part of Jenkins email.

All I'm able to get till now is the status code of the script execution.

Is there any possible way to capture the value of that variable var and send it as part of the Jenkins email content ?

Execute Shell: python -W ignore login.py

Email content: ${BUILD_LOG, maxLines=6} This is sending the log with last 6 lines.

The log contains the execute shell command and one line after that is the text that I want to send in Email content.

But ${BUILD_LOG_REGEX, regex="*ignore*", linesAfter=1} is not working.

  • Do you look for something like [this](https://stackoverflow.com/questions/36547680/how-to-do-i-get-the-output-of-a-shell-command-executed-using-into-a-variable-fro/40007801)? – wirnse Oct 30 '18 at 05:42
  • Similar to that. But not completely. I have a python script that prints the output. I tried using BUILD_LOG_REGEX in email content to filter out the lines in logs. But it's not working. It's giving me the same command that I mentioned in email content as email content not the found pattern in BUILD_LOG. – Tyrion Lannister Oct 30 '18 at 06:52
  • Please add some code to your question – wirnse Oct 30 '18 at 06:55

0 Answers0