adding version.py script

My company's legacy build system has an interesting, though slow
method of assigning version numbers to different branches/builds.

Moving projects to CI made life a lot easier, but at the same time
the version numbers were a little screwy still.  This code was
handy to allow projects built in the legacy build system to be
given the same version numbers by jenkins, without the excessive
overhead.