Skip to content

Commit

Permalink
Added version in flyteadmin (flyteorg#154)
Browse files Browse the repository at this point in the history
* wip: added version pkg

Signed-off-by: yuvraj <evalsocket@gmail.com>

* wip: resolve conflict

Signed-off-by: yuvraj <evalsocket@gmail.com>

* wip: added version in rpc

Signed-off-by: yuvraj <evalsocket@gmail.com>

* wip: small fixes

Signed-off-by: yuvraj <evalsocket@gmail.com>

* wip: Added panic cache in get version service

Signed-off-by: yuvraj <evalsocket@gmail.com>

* Added flytestdlib for version package

Signed-off-by: yuvraj <evalsocket@gmail.com>

* Added version service test

Signed-off-by: yuvraj <evalsocket@gmail.com>

* wip: added ldflags in goreleaser

Signed-off-by: yuvraj <evalsocket@gmail.com>
  • Loading branch information
yindia authored Apr 8, 2021
1 parent 09585b2 commit 19af628
Show file tree
Hide file tree
Showing 11 changed files with 191 additions and 252 deletions.
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ builds:
env:
- CGO_ENABLED=0
main: ./cmd/main.go
ldflags:
- -s -w -X github.com/flyteorg/flytestdlib/version.Version={{.Version}} -X github.com/flyteorg/flytestdlib/version.Build={{.ShortCommit}} -X github.com/flyteorg/flytestdlib/version.BuildTime={{.Date}}

binary: flyteadmin
goos:
- linux
Expand Down
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ include boilerplate/lyft/docker_build/Makefile
include boilerplate/lyft/golang_test_targets/Makefile
include boilerplate/lyft/end2end/Makefile

GIT_VERSION := $(shell git describe --always --tags)
GIT_HASH := $(shell git rev-parse --short HEAD)
TIMESTAMP := $(shell date '+%Y-%m-%d')
PACKAGE ?=github.com/flyteorg/flytestdlib

LD_FLAGS="-s -w -X $(PACKAGE)/version.Version=$(GIT_VERSION) -X $(PACKAGE)/version.Build=$(GIT_HASH) -X $(PACKAGE)/version.BuildTime=$(TIMESTAMP)"

.PHONY: update_boilerplate
update_boilerplate:
@boilerplate/update.sh
Expand All @@ -21,15 +28,15 @@ k8s_integration_execute:

.PHONY: compile
compile:
go build -o flyteadmin ./cmd/ && mv ./flyteadmin ${GOPATH}/bin
go build -o flyteadmin -ldflags=$(LD_FLAGS) ./cmd/ && mv ./flyteadmin ${GOPATH}/bin

.PHONY: linux_compile
linux_compile:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts/flyteadmin ./cmd/
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts/flyteadmin -ldflags=$(LD_FLAGS) ./cmd/

.PHONY: server
server:
go run cmd/main.go serve --server.kube-config ~/.kube/config --config flyteadmin_config.yaml
go run cmd/main.go serve --server.kube-config ~/.kube/config --config flyteadmin_config.yaml

.PHONY: migrate
migrate:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ require (
github.com/pquerna/cachecontrol v0.0.0-20201205024021-ac21108117ac // indirect
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/common v0.19.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
Expand Down
10 changes: 10 additions & 0 deletions pkg/config/serverconfig_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 19af628

Please sign in to comment.