diff --git a/RELEASE.md b/RELEASE.md index aea95bca..08ea500a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -37,15 +37,16 @@ Bump version 2. Checkout `master` branch. 3. Make a branch to release, for example by `git neco dev "$VERSION"` 4. Edit `CHANGELOG.md` for the new version ([example][]). -5. Commit the change and push it. +5. Edit `version.go` for the new version. +6. Commit the changes and push it. ```console $ git commit -a -m "Bump version to $VERSION" $ git neco review ``` -6. Merge this branch. -7. Checkout `master` branch. -8. Add a git tag, then push it. +7. Merge this branch. +8. Checkout `master` branch. +9. Add a git tag, then push it. ```console $ git tag "v$VERSION" diff --git a/pkg/coil-controller/cmd/root.go b/pkg/coil-controller/cmd/root.go index 92f41128..20e55b18 100644 --- a/pkg/coil-controller/cmd/root.go +++ b/pkg/coil-controller/cmd/root.go @@ -29,8 +29,9 @@ var etcdConfig *etcdutil.Config // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ - Use: "coil-controller", - Short: "A kubernetes controller for coil", + Use: "coil-controller", + Version: coil.Version, + Short: "A kubernetes controller for coil", Long: `coil-controller is a Kubernetes controller to maintain coil resources. It should be deployed as a Deployment pod in Kunernetes. diff --git a/pkg/coilctl/cmd/root.go b/pkg/coilctl/cmd/root.go index 226a39e8..76c10432 100644 --- a/pkg/coilctl/cmd/root.go +++ b/pkg/coilctl/cmd/root.go @@ -40,8 +40,9 @@ var etcdConfig *etcdutil.Config // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ - Use: "coilctl", - Short: "control and show coil settings", + Use: "coilctl", + Version: coil.Version, + Short: "control and show coil settings", Long: `coilctl is a command-line tool to control and show coil settings. It directly communicates with etcd. You need to prepare a diff --git a/pkg/coild/cmd/root.go b/pkg/coild/cmd/root.go index ef8f9997..f4a7a39c 100644 --- a/pkg/coild/cmd/root.go +++ b/pkg/coild/cmd/root.go @@ -54,8 +54,9 @@ var etcdConfig *etcdutil.Config // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ - Use: "coild", - Short: "Backend service to allocate IP address", + Use: "coild", + Version: coil.Version, + Short: "Backend service to allocate IP address", Long: `coild is a backend service to allocate IP address. It normally run as a DaemonSet container in Kubernetes. diff --git a/version.go b/version.go new file mode 100644 index 00000000..9dda30f9 --- /dev/null +++ b/version.go @@ -0,0 +1,4 @@ +package coil + +// Version represents the version of coil +const Version = "1.1.5"