Skip to content
Snippets Groups Projects
Commit 9770a472 authored by Gospodin Bodurov's avatar Gospodin Bodurov
Browse files

Merge branch 'devops20-monitoring' into 'master'

Devops20 monitoring

See merge request !23
parents fdb9b8e8 cdcfd987
No related branches found
No related tags found
2 merge requests!23Devops20 monitoring,!15WIP: Master
......@@ -2,6 +2,9 @@ SERVER_OUT := "bin/server"
PKG := "code.vereign.com/code/key-storage-agent"
SERVER_PKG_BUILD := "${PKG}"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
BRANCH := $(shell git branch | grep \* | cut -d ' ' -f2)
COMMIT := $(shell git branch | git describe --always --long --dirty)
VER := $(BRANCH).$(COMMIT)
.PHONY: all api server
......@@ -10,7 +13,7 @@ all: server
dep: ## Get the dependencies
dep ensure
server: dep ## Build the binary file for server
@go build -i -v -o $(SERVER_OUT) $(SERVER_PKG_BUILD)
@go build -ldflags="-X code.vereign.com/code/key-storage-agent/handler.version=$(VER)" -i -v -o $(SERVER_OUT) $(SERVER_PKG_BUILD)
clean: ## Remove previous builds
@rm $(SERVER_OUT)
......
......@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package handler
import (
"fmt"
"io/ioutil"
"strings"
......@@ -43,6 +44,8 @@ type KeyStorageServerImpl struct {
MaxMessageSize int
}
var version = "undefined"
func (s *KeyStorageServerImpl) CreateAuthentication(ctx context.Context) *authentication.Authentication {
if md, ok := metadata.FromIncomingContext(ctx); ok {
uuid := strings.Join(md["uuid"], "")
......@@ -194,3 +197,8 @@ func (s *KeyStorageServerImpl) ReserveKeyUUID(ctx context.Context, in *api.Reser
return reserveKeyUUIDResponse, nil
}
func (s *KeyStorageServerImpl) GetVersionKSA(ctx context.Context, in *api.GetVersionKSAMessage) (*api.GetVersionKSAResponseMessage, error) {
fmt.Println("Version: " + version)
return &api.GetVersionKSAResponseMessage{Version: version, Errors: ""}, nil
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment