Hi,
I would like to set a timestamp at the beginning of my pipeline build, put
it into the environment, and reuse it throughout my build.
I found some sample code - but it no longer seems to work because of
sandboxing of the groovy pipeline scripts.
The code is:
env.TIMESTAMP = new java.text.SimpleDateFormat('yyyyMMddHHmmss').format(new
Date())
But I get this error now:
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts
not permitted to use new java.text.SimpleDateFormat java.lang.String
at
org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectNew(StaticWhitelist.java:185)
How should I be setting a timestamp value that I can reuse over throughout the
rest of my build?
Thanks,
Greg
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/fae69470-a517-4167-a9fb-655170f92084%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.