Can $B be reset to '1' every day programatically?
Hi,
I have a customer who wants to automatically reset the value of $B every day, where $B is the default tag variable, which starts at 1 and gets incremented for every job, and can be used in tags, which are represented by BF_TAG. For example, On Monday, BUILD_1, BUILD_2, ...., BUILD_7 On Tuesday, instead of BUILD_8, BUILD_9, ...., BUILD_15 they would like to see a repeat of Monday's values, e.g., On Tuesday, BUILD_1, BUILD_2, ...., BUILD_5 When we run a project, from the UI's "Job Details" tab, there is a way to manually set 'B' to any value the user desires. Our question: Can this be done programatically? --Randy |
One answer
The short answer is yes. You could use the Build Forge Java or Perl API to set the value of $B in any project back to a particular value. This could then be automated in (wait for it...) a Build Forge project! Run the schedule every night and you're set. I'm not positive, but you might be able to do this type of update directly from bftool: http://www.ibm.com/developerworks/rational/library/08/0930_toma/index.html
My concern is that you have to make sure that the temporary directories created when a project is run are cleared out. Otherwise, you risk clobbering old results found in BUILD_1, etc. This might be easily done by using a Class that deletes all records every day -- but I'd still be very cautious with this! You might want to manually clear all directories every day. The other option is to use a date timestamp on every build run. For example, label the build as BUILD_20110927-132534. This would likely satisfy your customer and is much easier to maintain long term. The goal of a build tag is to make it easy to refer back to -- you shouldn't be removing them all the time. |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.