Skip to content

Commit

Permalink
Version (#16)
Browse files Browse the repository at this point in the history
* Add build info to output

* Remove extraneous file

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
  • Loading branch information
peterbroadhurst authored Jul 24, 2018
1 parent 73b9ad9 commit eb89254
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 40 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: go

env:
- BUILD_VERSION=travis-CI
before_install:
- sudo add-apt-repository -y ppa:ethereum/ethereum
- sudo apt-get update
Expand Down
34 changes: 0 additions & 34 deletions 1

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BINARY_WIN=$(BINARY_NAME)-win

all: deps build test
build:
$(GOBUILD) -tags=prod -o $(BINARY_NAME) -v
$(GOBUILD) -ldflags "-X main.buildDate=`date -u +\"%Y-%m-%dT%H:%M:%SZ\"` -X main.buildVersion=$(BUILD_VERSION)" -tags=prod -o $(BINARY_NAME) -v
test:
$(GOTEST) ./... -cover -coverprofile=coverage.txt -covermode=atomic
clean:
Expand Down
6 changes: 2 additions & 4 deletions cmd/ethconnect.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ var serverCmdConfig struct {
}

var rootCmd = &cobra.Command{
Use: "ethconnect [sub]",
Short: "Connectivity Bridge for Ethereum permissioned chains\n" +
"Copyright (C) 2018 Kaleido, a ConsenSys business\n" +
"Licensed under the Apache License, Version 2.0",
Use: "ethconnect [sub]",
Short: "Connectivity Bridge for Ethereum permissioned chains",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
initLogging(rootConfig.DebugLevel)
},
Expand Down
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@
package main

import (
"fmt"
"os"

"github.com/kaleido-io/ethconnect/cmd"
)

var buildDate, buildVersion string // Set by ldflags

func main() {
print("Copyright (C) 2018 Kaleido, a ConsenSys business\n" +
"Licensed under the Apache License, Version 2.0\n")
print(fmt.Sprintf("Version: %s (Build Date: %s)\n\n", buildVersion, buildDate))
exitVal := cmd.Execute()
os.Exit(exitVal)
}

0 comments on commit eb89254

Please sign in to comment.