Releasing with bumpversion, govvv and drone
One of pleasures about coding is using good tools. Recently I use bumpversion, govvv and drone for version releasing.
bumpversion⌗
bumpversion is automation for semantic versioning. Most of my projects have simple config file like below. (.bumpversion.cfg)
Before release,I just run like below:
This update minor version number in VERSION file. (In this case, 0.8,4
-> 0.9.0
)
And I configure commit=True
and tag=True
in .bumpversion.cfg,The bumpversion makes a commit and tag.
govvv⌗
govvv is go binary versioning tool that wraps the go build command. Go provides access to setting variables by compile time linker flags. govvv provides easy versioning for go versioning even I don’t know that --ldflag
of go build
.
I just created version/version.go
Because I make new VERSION
file with bumpversion, govvv adds a Version variable from VERSION
file to my version package.
I like to seperate version variable with main.go. version variable can be used in another ways. (e.g. metric labels, api version call..)
drone⌗
drone is an open source continuous delivery tool. Interesting features of drone are that all tasks in drone is docker containers and drone’s yaml configure file is a superset of docker-compose configure file.
If repository tag hooks is enable in drone settings (default disable),git commit tag will sync up with docker tag. This is simply how to use the tools for releasing and versioning.