versioning and .gitignore updates
This commit is contained in:
parent
8225a5a609
commit
d5c026948c
|
@ -1,3 +1,4 @@
|
||||||
/watchdog
|
/watchdog
|
||||||
/cmd/watchdog/watchdog
|
/cmd/watchdog/watchdog
|
||||||
xversion.go
|
xversion.go
|
||||||
|
*.json
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
// Fallback to recent version if not in a git repository
|
||||||
|
func init() {
|
||||||
|
GitVersion = "v1.1.2"
|
||||||
|
GitTimestamp = "2019-06-21T00:54:34-06:00"
|
||||||
|
}
|
|
@ -14,11 +14,7 @@ import (
|
||||||
watchdog "git.rootprojects.org/root/watchdog.go"
|
watchdog "git.rootprojects.org/root/watchdog.go"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var GitRev, GitVersion, GitTimestamp string
|
||||||
GitRev = "00000000"
|
|
||||||
GitVersion = "v0.0.0"
|
|
||||||
GitTimestamp = "0000-00-00T00:00:00Z"
|
|
||||||
)
|
|
||||||
|
|
||||||
func usage() {
|
func usage() {
|
||||||
fmt.Println("Usage: watchdog -c config.json")
|
fmt.Println("Usage: watchdog -c config.json")
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -2,4 +2,4 @@ module git.rootprojects.org/root/watchdog.go
|
||||||
|
|
||||||
go 1.12
|
go 1.12
|
||||||
|
|
||||||
require git.rootprojects.org/root/go-gitver v1.1.0
|
require git.rootprojects.org/root/go-gitver v1.1.1
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -1,2 +1,4 @@
|
||||||
git.rootprojects.org/root/go-gitver v1.1.0 h1:ANQUnUXYgbDR+WaMcI+PQQjLnxlCbAZCD/zivkrf8fY=
|
git.rootprojects.org/root/go-gitver v1.1.0 h1:ANQUnUXYgbDR+WaMcI+PQQjLnxlCbAZCD/zivkrf8fY=
|
||||||
git.rootprojects.org/root/go-gitver v1.1.0/go.mod h1:Rj1v3TBhvdaSphFEqMynUYwAz/4f+wY/+syBTvRrmlI=
|
git.rootprojects.org/root/go-gitver v1.1.0/go.mod h1:Rj1v3TBhvdaSphFEqMynUYwAz/4f+wY/+syBTvRrmlI=
|
||||||
|
git.rootprojects.org/root/go-gitver v1.1.1 h1:5b0lxnTYnft5hqpln0XCrJaGPH0SKzhPaazVAvAlZ8I=
|
||||||
|
git.rootprojects.org/root/go-gitver v1.1.1/go.mod h1:Rj1v3TBhvdaSphFEqMynUYwAz/4f+wY/+syBTvRrmlI=
|
||||||
|
|
|
@ -60,7 +60,7 @@ You don't have to use `mod vendor`, but I highly recommend it.
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
|
|
||||||
```
|
```txt
|
||||||
version print version and exit
|
version print version and exit
|
||||||
--fail exit with non-zero status code on failure
|
--fail exit with non-zero status code on failure
|
||||||
--package <name> will set the package name
|
--package <name> will set the package name
|
||||||
|
@ -69,7 +69,7 @@ version print version and exit
|
||||||
|
|
||||||
ENVs
|
ENVs
|
||||||
|
|
||||||
```
|
```bash
|
||||||
# Alias for --fail
|
# Alias for --fail
|
||||||
GITVER_FAIL=true
|
GITVER_FAIL=true
|
||||||
```
|
```
|
||||||
|
@ -142,7 +142,7 @@ the repository in itself and that would be... weird.
|
||||||
|
|
||||||
# Why a tools package?
|
# Why a tools package?
|
||||||
|
|
||||||
> import "git.rootprojects.org/root/go-gitver" is a program, not an importable package
|
> import "git.rootprojects.org/root/go-gitver" is a program, not an importable package
|
||||||
|
|
||||||
Having a tools package with a build tag that you don't use is a nice way to add exact
|
Having a tools package with a build tag that you don't use is a nice way to add exact
|
||||||
versions of a command package used for tooling to your `go.mod` with `go mod tidy`,
|
versions of a command package used for tooling to your `go.mod` with `go mod tidy`,
|
||||||
|
|
|
@ -209,9 +209,9 @@ package {{ .Package }}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
GitRev = "{{ .GitRev }}"
|
GitRev = "{{ .GitRev }}"
|
||||||
if "" != "{{ .Version }}" {
|
{{- if .Version }}
|
||||||
GitVersion = "{{ .Version }}"
|
GitVersion = "{{ .Version }}"
|
||||||
}
|
{{ end -}}
|
||||||
GitTimestamp = "{{ .Timestamp }}"
|
GitTimestamp = "{{ .Timestamp }}"
|
||||||
}
|
}
|
||||||
`))
|
`))
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
# git.rootprojects.org/root/go-gitver v1.1.0
|
# git.rootprojects.org/root/go-gitver v1.1.1
|
||||||
git.rootprojects.org/root/go-gitver
|
git.rootprojects.org/root/go-gitver
|
||||||
|
|
Loading…
Reference in New Issue