Skip to content

Commit

Permalink
Add version.go and version flags to some commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
ymmt2005 committed Aug 23, 2019
1 parent a37393f commit 8474e8e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
9 changes: 5 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions pkg/coil-controller/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions pkg/coilctl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions pkg/coild/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package coil

// Version represents the version of coil
const Version = "1.1.5"

0 comments on commit 8474e8e

Please sign in to comment.