diff --git a/.gitignore b/.gitignore index 86a80ab..3a8fad9 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ vendor/ # End of https://www.gitignore.io/api/go example-client +bin/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b862ddb --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +LINUX=bin/nhite-sample-cli-linux-amd64 +WINDOWS64=bin/nhite-sample-cli-amd64.exe +DARWIN=bin/nhite-sample-cli-darwin64 + +# These are the values we want to pass for VERSION and BUILD +# # git tag 1.0.1 +# # git commit -am "One more change after the tags" +VERSION=`git describe --tags` +BUILD=`date +%FT%T%z` + +LDFLAGS=-ldflags "-w -s -X main.Version=${VERSION} -X main.Build=${BUILD}" + +all: $(LINUX) $(WINDOWS64) $(WINDOWS32) $(DARWIN) + +$(LINUX): *.go + GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o $(LINUX) *.go + +$(WINDOWS64): *.go + GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o $(WINDOWS64) *.go + +$(DARWIN): *.go + GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o $(DARWIN) *.go + + diff --git a/env.sh b/env.sh index eee19e8..70db9c9 100644 --- a/env.sh +++ b/env.sh @@ -1,2 +1,2 @@ -export TAAS_CLIENT_CERT_FILE="../out/test.crt" -export TAAS_CLIENT_TAAS_ADDRESS="127.0.0.1:1234" +export NHITE_CLIENT_CERT_FILE="../out/test.crt" +export NHITE_CLIENT_TAAS_ADDRESS="127.0.0.1:1234" diff --git a/main.go b/main.go index b770c56..9f0b7e7 100644 --- a/main.go +++ b/main.go @@ -19,7 +19,7 @@ import ( "google.golang.org/grpc/credentials" ) -const envPrefix = "TAAS_CLIENT" +const envPrefix = "NHITE_CLIENT" type configuration struct { CertFile string `envconfig:"CERT_FILE" required:"true"`