From 872bb197153ff07f742e2b5d70ef59e630fc48da Mon Sep 17 00:00:00 2001 From: Ahmet Alp Balkan Date: Thu, 4 Aug 2016 21:36:59 -0700 Subject: [PATCH] README update GIFs and stuff Signed-off-by: Ahmet Alp Balkan --- LICENSE | 2 +- README.md | 60 +++++++++++++++++++++++++++---------------------------- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/LICENSE b/LICENSE index 8dada3e..c1ab55f 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright 2016 Ahmet Alp Balkan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 646ecc3..64c000f 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,38 @@ # govvv -The simple Go binary versioning tool that wraps the `go build` command. Stop -worrying about `-ldflags` and use `govvv`: +The simple Go binary versioning tool that wraps the `go build` command. - go get github.com/ahmetalpbalkan/govvv - govvv build . +![](https://cl.ly/0U2m441v392Q/intro-1.gif) + +Stop worrying about `-ldflags` and **`go get github.com/ahmetalpbalkan/govvv`** now. ## Build Variables | Variable | Description | Example | |----------|-------------|---------| -| `main.GitCommit` | short commit hash of source tree | `0b5ed7a` | -| `main.GitBranch` | current branch name the code is built off | `master` | -| `main.GitState` | whether there are uncommitted changes | `clean` or `dirty` | -| `main.BuildDate` | RFC3339 formatted UTC date | `2016-08-04T18:07:54Z` | -| `main.Version` | contents of `./VERSION` file, if exists | `2.0.0` | - -## Installing govvv is easy - -Download `govvv` via `go get` or from Releases tab (recommended). - - go get github.com/ahmetalpbalkan/govvv +| **`main.GitCommit`** | short commit hash of source tree | `0b5ed7a` | +| **`main.GitBranch`** | current branch name the code is built off | `master` | +| **`main.GitState`** | whether there are uncommitted changes | `clean` or `dirty` | +| **`main.BuildDate`** | RFC3339 formatted UTC date | `2016-08-04T18:07:54Z` | +| **`main.Version`** | contents of `./VERSION` file, if exists | `2.0.0` | ## Using govvv is easy -Just add the Build Variables described above to your main package and build your -code with `govvv`. +Just add the build variables you want to the `main` package and run: -```go -package main +| old | :sparkles: new :sparkles: | +| -------------|-----------------| +| `go build` | `govvv build` | +| `go install` | `govvv install` | -import "fmt" +## Version your app with govvv -var ( - // these values are provided by govvv at compile-time - GitCommit, GitState string -) +Create a `VERSION` file in your build root directory and add a `Version` +variable to your `main` package. -func version() string { return GitCommit + "-" + GitState } +![](https://cl.ly/3Q1K1R2D3b2K/intro-2.gif) -func main() { - fmt.Printf("Hello! build=%s", version()) - // Hello! build=e32f923-dirty -} -``` +Do you have your own way of specifying `Version`? No problem: ## govvv lets you specify custom `-ldflags` @@ -53,7 +42,16 @@ Your existing `-ldflags` argument will still be preserved: and the `-ldflags` constructed by govvv will be appended to your flag. +## Try govvv today + + $ go get github.com/ahmetalpbalkan/govvv + +------ + +govvv is distributed under [Apache 2.0 License](LICENSE). + +Copyright 2016 Ahmet Alp Balkan ------ -[![Build Status](https://travis-ci.org/ahmetalpbalkan/govvv.svg?branch=master)](https://travis-ci.org/ahmetalpbalkan/govvv) \ No newline at end of file +[![Build Status](https://travis-ci.org/ahmetalpbalkan/govvv.svg?branch=master)](https://travis-ci.org/ahmetalpbalkan/govvv)