Skip to content

Commit

Permalink
Fix versioning logic
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsparky committed Mar 1, 2019
1 parent a999a90 commit 35e1739
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ matrix:
- env: BUILDOS="linux" BUILDARCH="amd64" FILEEXT="bin"
- env: BUILDOS="linux" BUILDARCH="386" FILEEXT="bin"
script:
- GO111MODULE="on" GOOS=$BUILDOS GOARCH=$BUILDARCH go build -ldflags "-s -w" -o /tmp/geowall-$BUILDOS-$BUILDARCH.$FILEEXT
- GO111MODULE="on" GOOS=$BUILDOS GOARCH=$BUILDARCH go build -ldflags "-s -w -X main.Version=$TRAVIS_TAG" -o /tmp/geowall-$BUILDOS-$BUILDARCH.$FILEEXT
9 changes: 3 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
var V4URL string = "http://www.ipdeny.com/ipblocks/data/aggregated/%s-aggregated.zone"
var V6URL string = "http://www.ipdeny.com/ipv6/ipaddresses/aggregated/%s-aggregated.zone"

var Version string

var fw *Firewall

type Firewall struct {
Expand Down Expand Up @@ -297,12 +299,7 @@ func main() {
}
app.Copyright = "(c) 2019 Matt Spurrier"
app.Usage = "GeoIP Based Firewall"

if os.Getenv("TRAVIS_TAG") == "" {
app.Version = os.Getenv("TRAVIS_COMMIT")
} else {
app.Version = os.Getenv("TRAVIS_TAG")
}
app.Version = Version

app.Flags = []cli.Flag{
cli.BoolFlag{
Expand Down

0 comments on commit 35e1739

Please sign in to comment.