Skip to content

Commit

Permalink
version fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kdudkov committed Feb 15, 2022
1 parent 9e94190 commit ce0dd97
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ default: all
all: dep test build

GIT_REVISION=$(shell git describe --always --dirty)
GIT_COMMIT=$(shell git rev-parse --short HEAD)
GIT_BRANCH=$(shell git rev-parse --symbolic-full-name --abbrev-ref HEAD)

LDFLAGS=-ldflags "-s -X main.gitRevision=$(GIT_REVISION) -X main.gitCommit=$(GIT_COMMIT)"
LDFLAGS=-ldflags "-s -X main.gitRevision=$(GIT_REVISION) -X main.gitBranch=$(GIT_BRANCH)"

.PHONY: clean
clean:
Expand Down
6 changes: 4 additions & 2 deletions cmd/goatak_server/cert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
)

func TestCert(t *testing.T) {
t.SkipNow()

go func() {
Server(":55555", "../../ca.pem", "../../ca.key")
}()
Expand Down Expand Up @@ -75,8 +77,8 @@ func Server(addr, certFile, keyFile string) (err error) {
}
}

func Client(addr, caFile, certFile, keyFile string) {
conn, err := tls.Dial("tcp", addr, getTlsConfig(caFile, certFile, keyFile))
func Client(addr, caFile, p12file, passw string) {
conn, err := tls.Dial("tcp", addr, getTlsConfig(caFile, p12file, passw))
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/goatak_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

var (
gitRevision = "unknown"
gitCommit = "unknown"
gitBranch = "unknown"
lastSeenOfflineTimeout = time.Minute * 2
)

Expand Down Expand Up @@ -336,7 +336,7 @@ func (app *App) SendToCallsign(callsign string, msg *cotproto.TakMessage) {
}

func main() {
fmt.Printf("version %s %s\n", gitRevision, gitCommit)
fmt.Printf("version %s %s\n", gitRevision, gitBranch)
var logging = flag.Bool("logging", false, "save all events to files")
var conf = flag.String("config", "goatak_server.yml", "name of config file")
flag.Parse()
Expand Down
2 changes: 1 addition & 1 deletion cmd/goatak_server/marti_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func getVersionConfigHandler(app *App) func(req *air.Request, res *air.Response)
result["type"] = "ServerConfig"
result["nodeId"] = "1"
data["api"] = "2"
data["version"] = gitRevision + ":" + gitCommit
data["version"] = gitRevision + ":" + gitBranch
data["hostname"] = "0.0.0.0"
result["data"] = data
return func(req *air.Request, res *air.Response) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/webclient/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func getUnitsHandler(app *App) func(req *air.Request, res *air.Response) error {

func getConfigHandler(app *App) func(req *air.Request, res *air.Response) error {
m := make(map[string]interface{}, 0)
m["version"] = gitRevision + ":" + gitCommit
m["version"] = gitRevision + ":" + gitBranch
m["lat"] = app.lat
m["lon"] = app.lon
m["zoom"] = app.zoom
Expand Down
2 changes: 1 addition & 1 deletion cmd/webclient/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const (

var (
gitRevision = "unknown"
gitCommit = "unknown"
gitBranch = "unknown"
)

type App struct {
Expand Down

0 comments on commit ce0dd97

Please sign in to comment.