time-ver
Time based versioning
For versioning published releases of websites/services, we use a datetime based string to denote different releases
DATE.TIME.SUBTIME
- DATE, a YYYYMMDD formatted value
- YYYY is a 4 digit year (e.g. 2015)
- MM is a 2 digit month (e.g. 06)
- DD is a 2 digit day (e.g. 08)
- TIME, a HHMMSS formatted value
- HH is a 2 digit hour (e.g. 08)
- MM is a 2 digit minute (e.g. 25)
- SS is a 2 digit second (e.g. 22)
- SUBTIME, a N formatted value
- N is a 9 digit nanosecond (e.g. 039235885)
// TODO: Maybe use date %
notation instead?
Example:
20150608.082522.039235885
Generating on GNU/Linux:
date --utc +%Y%m%d.%H%M%S.%N
When we began automating our release process for websites/services, we found there was no well formed solution to identifying what release is live.
semver
doesn't play nice with automation, usually minor or patch is bumped without any consideration- Introducing actual
semver
releases into automated releases is possible but doesn't gain any value from a maintainer's perspective
- Introducing actual
- Using revisions from
git
works but makes it hard for human's to refer to reference and has no intrinsic value
We solved this by using time; a very practical value from a human's perspective. From a given version, we know when it was created and can reuse that reference during the publication process.
Other benefits include:
- Compatible with semver libraries (although,
x
and*
lose meaning quickly) - Lexically sortable
We like to use our versioning in:
git tag
at publication (e.g. creating/pushing a new release)- Folder/archive name for release (e.g. stored on server with archive for easy debugging of live version)
ruby
flavor:$ ruby -e "require 'date'; puts DateTime::now().strftime('%Y%m%d.%H%M%S.%N')" 20150821.004046.688937332