A version bumping tool based on node.js
npm install bumpversionBump the version to a json file (VERSION.json)
npm install bumpversionAfter the installation, you can run
``shell`
$ bumpversion -m v0.1.1 -c 1
And it would return would something like
``
version bumped to:
{
"cache": 1,
"timestamp": "2013-06-03T03:57:17.273Z",
"main": "v0.1.1"
}
Meanwhile, a file named VERSION.json would be created with same content.
* main
A string field, indicating the main version. Could be something like "release/v1.2.3"
* cache
A integer field indicating the cache version. A good usercase of this field is CDN versioning.
If you do not specify "-c", this field would be self increment.
* timestamp
A GMT timestamp indicating when the file being generated.
* last_commits
If you are using git, you can call bumpversion -lc 3, it would include last three commits version hash and log message into last_commits.
shell
$ git branch
develop
master
* release/0.1.1
`Now execute "bumpversion"
`shell
$ bumpversion
version bumped to:
{
"cache": 5,
"timestamp": "2013-06-03T03:53:55.972Z",
"main": "release/0.1.1"
}
`$3
Including last 2 commits
`
bumpversion -lc 2
version bumped to:
{
"cache": 2,
"timestamp": "2013-06-03T04:16:18.487Z",
"main": "release/0.1.1",
"last_commits": [
"0f0ef3da436f5f5f71dcbf78ce720bcd2ff47e7e version bumped",
"a9b14b2ee13a532534d8e75e0e83192534cbd8cc Merge branch 'release/0.1' into develop"
]
}
`Including last 5 commits
`
bumpversion -lc 5
version bumped to:
{
"cache": 3,
"timestamp": "2013-06-03T04:19:07.317Z",
"main": "release/0.1.1",
"last_commits": [
"0f0ef3da436f5f5f71dcbf78ce720bcd2ff47e7e version bumped",
"a9b14b2ee13a532534d8e75e0e83192534cbd8cc Merge branch 'release/0.1' into develop",
"82f901f53fe61fc469c869a5da009aaec26d4b06 include the test",
"73a5c11f9675f67556ad691f023255761568bf97 misc changes",
"83c4c440ac4b47fc0d6fbb5f5b84339889e0e075 add package.json"
]
}
`
Usage
Displaying the help`shell
$> bumpversion -h
``
usage: bumpversion [-h] [-v] [-m M] [-c C] [-q] [-lc LC]A tool to generate / bump the version to a JSON file.
Optional arguments:
-h, --help Show this help message and exit.
-v, --version Show program's version number and exit.
-m M Update the main version. If you do not specify version
number, Main version will be take it as git branch by
default.
-c C Update the cache version. If you not specify version number,
it would be a self increment number
-q quiet mode.
-lc LC Update the last default commit
``