Hi guys,
I have a question about using fb projects with persistent variables in continua. If I’m running projects from my TFS repository that have persistent variables, are the values of these variables going to successfully saved for each subsequent time I run the project using continua? From what I understand the values are stored in .fbpinf files that are created alongside the project file, but then presumably would require write access to my TFS repository? How would this work? Is it possible? I imagine it might not, especially as the repository may be reset. The variable I’m trying to store is just the last build date so we can retrieve the relevant changeset infomation during each build, but I suppose there may be a way of storing this in continua instead and passing it to the project each time?
Any info would be appreciated.
Regards,
Hi Luke,
We don’t currently have a way in Continua of persisting variables between builds. The main reason this has not been implemented is that the nature of the continuous build system is that we don’t know which order the builds will finish, and there is likely to be concurrency issues with more than one build attempting to persist the variable at the same time.
With your example of last build date, another build may still been running when the next build starts and finish before the FinalBuilder action runs. The last build date retrieved at the start of the build would now be incorrect at the time that FinalBuilder action runs.
We also don’t have a way of committing changes to repositories within Continua. This is something that we may implement eventually, although there are significant challenges with handling merging changes when pushing to distributed repositories. We are more likely to implement a persistent variable store first - one which can be queried to initialise variables at the start of each build. This is on our to-do list but still requires some design thought.
Currently the only workaround would be to run a second FinalBuilder project with an action to check the .fbpinf file into the repository after the first project has been run.
Hi Dave,
Thanks for the explanation, appreciated! It’s a shame I’m not able to access last build date in continua (e.g. something like $Configuration.LastRun$) which I think would certainly be useful, but I guess it would have to be passed to the fb project first before its value gets updated, it that what you meant? The frequency of our builds are generally pretty low so I don’t think clashing/overlapping builds would be an issue, for us at least.
I think if we can’t access the last build date through continua we’ll probably just save a timestamp to an .ini that the project can read instead of trying to mess around with the fbpinf files.
Thanks again,
Hi Luke,
Yes, the ini file is your best way forward at the moment.
Can I ask what you propose to do with the last run date? Could this be the last date/time of the last build which was finished before the current build started or do you need to check it at the instance when an action starts?
Hi Dave,
I require a timestamp of the last time the build was run so that I can retrieve all TFS changesets since that date. So when we build our application a send email action will list all the changesets that were included in that particular build. So the last run date would need to be passed to the current build to run the TFS query, then the date would be updated at the end of that build. Hope that makes sense!
Regards,
Hi Luke,
If you use Continua notifications to send the email, the default template will list all the changesets associated with the build. You can then set the Associate Changesets property on the repository trigger to “all since last sucessful build”.
I hadn’t considered using continua notifications… Thanks Dave, I’ll give this a try.