Install the EnvInject plugin (
https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin).
In your job, make your first step get the current time in the format you prefer and write that out to a file called times.properties. Here is how in Linux:
touch times.properties # create the file
TIME=date +%s # seconds since epoch
echo START_TIME = ${TIME} >> times.properties
After you finish the main job, have your next step write another timestamp to times.properties
TIME=date +%s # seconds since epoch
echo END_TIME = ${TIME} >> times.properties
Then create an "Inject environment variables" step (which requires the plugin) and load them from times.properties.
Finally, open up another shell step and you will have START_TIME and END_TIME as environment variables. Do the math, et voila!
--Rob
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
jenkinsci-use...@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.
Click
https://www.mailcontrol.com/sr/AeynyPUxbszGX2PQPOmvUikZGg4PuPFTdX0L8fzvSFvPzOIV2M9nacuAsLSybwr0oyxjTtESlxiZDddCOqP2wA== to report this email as spam.
This e-mail and the information, including any attachments it contains, are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.
Thank you.
Please consider the environment before printing this email.