dashy // special variables
special variablesDashy will allow you to use some special variables, alongside the 'variable replacement maps'. I will document them fully below, but a quick listing is: %dashy.revision% The revision that the deployed code was built with. %dashy.committime% The date the *commit* took place (the commit from dashy client) %dashy.commithistory% The series of log messages that have been committed %dashy.revision%This is simply a .NET long and it refers to the revision number of the trunk repository. Actually, it is the revision number of the directory you've specified in the versioning directory of dashy client, but this should be your trunk. %dashy.committime%This is the time when you clicked 'deploy' in dashy client, and is a long retried from the call DateTime.Now.ToBinary(). It should be possible to re-instate this into an appropriate time object in any language; but in .NET in particular, it can be retrieved via DateTime t = DateTime.FromBinary(%dashy.committime%L); (note the "L" to signify a long literal). %dashy.commithistory%This gives you access to the underlying source controls log of information, for the specific versioning directory (that you've configured previously. It's encoded in a single-line base64 message for easy storage in whatever config or file you happen to reference it in. As an example of what is possible with it:
The format of the data is like so (pseudocode): base64(
for 0 to max_history_items
Author // string
(char) 0x01
Revision // 'long' .net type
(char) 0x01
CommitTime // DateTime.ToBinary()
(char) 0x01
base64(commit message) // string
(char) 0x01
base64(changedPaths seperated with (char) 0x0d (char) 0x0a) // string
(char) 0x0d (char) 0x0a
end for
)
Thus, to decode it, you de-base64 the entire message, split based on lines, split based on 0x01, grab out appropriate items, and de-base64 the commit-message and changed paths. You can configure the number of items returned by adjusting the MaxHistoryItems variable. If it is set to 0, it will return all items ever entered. Note that the items are, currently, returned to you in ASCENDING order (i.e earliest commit is first). You will probably want to re-order them. If you want to have, say, just a log of the changes for yourself, accessible on your site, you could simply write the variable into a .txt file, and put appropriate permissions on it. It is interesting to that that, using this variable, you can effectively create a series of release notes, to be displayed on your public site (or perhaps an XML feed of updates). I would suggest that you may not want all your commits to be public, so you can consider an approach of writing public: in front of the commit messages you want to be seen publically, and then check for that in the code where you display the list that dashy provides. (Note that this may mean you get less than the max, so potentially set your MaxHistoryItems variable higher.) I have implemented this here, a viewing of this data on this website, at /log (you can get there by clicking the revision number at the bottom of the page). To add a variable to one of your releases, just add it to the overall project, and set it to have a value anything (but it must have a value). This value will then be over-written during the commit phase, on dashy client. |
