Reputation: 101
I am using groovy script to get the build status of a jenkins job running currently as a post build action, like this:
def result = manager.build.result
manager.listener.logger.println "And the result is: ${result}"
Now I want to send the value of "result" variable to a specific location in a file
Since I am new to groovy, I don't know much, Is there a way to achieve this, like we do in shell scripts:
echo $result > file
Upvotes: 0
Views: 3743
Reputation: 34478
If you want to just write a line once to the file you can use next call:
new File("file").write(result)
Upvotes: 1