From eb8925483cfb99542452f89e1e0d0a0067fa8603 Mon Sep 17 00:00:00 2001 From: Peter Broadhurst Date: Tue, 24 Jul 2018 11:52:58 -0400 Subject: [PATCH] Version (#16) * Add build info to output * Remove extraneous file Signed-off-by: Peter Broadhurst --- .travis.yml | 3 ++- 1 | 34 ---------------------------------- Makefile | 2 +- cmd/ethconnect.go | 6 ++---- main.go | 6 ++++++ 5 files changed, 11 insertions(+), 40 deletions(-) delete mode 100644 1 diff --git a/.travis.yml b/.travis.yml index a8c1fb98..db12e8c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/1 b/1 deleted file mode 100644 index 8c208c88..00000000 --- a/1 +++ /dev/null @@ -1,34 +0,0 @@ -# github.com/kaleido-io/ethconnect - -[![Coverage report](https://codecov.io/gh/kaleido-io/ethconnect/branch/master/graph/badge.svg)](https://codecov.io/gh/kaleido-io/ethconnect) - -> Currently pre-release - please check back soon for updates - -Open Source component that is used as part of [Kaleido Connect](https://kaleido.io). - -Provides an integration bridge into Ethereum permissioned chains, from simple -Web Service and Messaging interfaces that are friendly to existing Enterprise -applications & middleware. -For example to allow connectivity from an Enterprise Service Bus (ESB) or other -Enterprise Application Integration (EAI) tier, or applications running in a -Java EE Application Server. -Provides Key Management System (KMS) integration for signing transactions. - -Technology support currently includes: -- Messaging - - Apache Kafka - https://kafka.apache.org/ -- Webhooks - - Simple POST of a transaction over HTTP in YAML/JSON queued to Kafka for processing - -Under development: - -- Key Management Service - - AWS Key Management Service - https://aws.amazon.com/kms/ - -## License - -This code is distributed under the [Apache 2 license](LICENSE). - -> Please note the code currently statically links to code distributed under the -> LGPL license. - diff --git a/Makefile b/Makefile index 458b04ce..c8435ad7 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/cmd/ethconnect.go b/cmd/ethconnect.go index 4f7c3ed1..89b673c4 100644 --- a/cmd/ethconnect.go +++ b/cmd/ethconnect.go @@ -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) }, diff --git a/main.go b/main.go index 0b7992f2..69ab480f 100644 --- a/main.go +++ b/main.go @@ -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) }