Hi all,
We're rolling some projects across from Hudson into Bamboo and have hit a problem with one of them.
This project builds with Ant and uses some of the Hudson timestamp variables to set the build time into an environment variable. The environment variable is in turn used to create a specific build folder.
I tried to do the same thing using Bamboo's buildTimeStamp variable, but unfortunately for me it is listed as "ISO8601" which means that it gives a full dump in the full format specified in that standard - including some characters that the OS doesn't like as part of directory names.
I can't find anything to suggest that alternate formatting which are also part of that standard are supported, or how to specify them.
I'd like the timestamp in DDMMYYYY format, so is anyone able to help with able to get that output from this variable?
In the meantime, I'm just going to set it to use the build number so the project can at least execute.
TIA,
Jason [SolveIT Software]
Hi Jason,
There isn't any way to change the bamboo.buildTimeStamp format, however I've opened up an improvement request to add a similar variable that outputs to a simpler date format that is more file system friendly.
Thanks
James
Thanks for that James, I'll watch for the enhancement in some future Bamboo release... but as I said we'll just use the build ID for the moment, and that's successful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm having the same issue. All I really want is "yyyyMMdd"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can actually set a plan variable to the system date if this is building on a linux machine by setting the value of the plan variable to something like
$(date +"%m-%d-%y-%l-%M-%S")
This will return as mm-dd-yy-hh-mm-ss. You could change the format to that of your liking. However this will not transfer to a deployment plan as the deployment plan picks up the string and not the value returned by it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Workaround for now:
Create a script task in bamboo:
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > timestamp.pom echo "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">" >> timestamp.pom echo -n "<version>" >> timestamp.pom echo -n `date +'%Y%m%d%H%M%S'` >> timestamp.pom echo "</version>" >> timestamp.pom echo "</project>" >> timestamp.pom
Use the "Maven POM Value Extractor" plugin. Override the project file in this task to read from timestamp.pom
Now the custom timestamp is available in ${bamboo.maven.version}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.