Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

[patch] add go binary version during build time #25

Merged
merged 11 commits into from
Jan 30, 2020

Conversation

WindzCUHK
Copy link
Contributor

@WindzCUHK WindzCUHK commented Dec 12, 2019

issue

go binary only print the config file format version currently

format

${APP_VERSION} at ${BUILD_TIME} by ${GO_VERSION}
e.g. 1.2.33333 at 20200128-025155 by go1.13.6 linux/amd64

TODO

  • also add go binary version during building
  • verify PR
  • fix other sidecars

main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Jan 27, 2020

Codecov Report

Merging #25 into master will decrease coverage by 6.04%.
The diff coverage is 41.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
- Coverage    95.7%   89.66%   -6.05%     
==========================================
  Files          10       11       +1     
  Lines         582      648      +66     
==========================================
+ Hits          557      581      +24     
- Misses         14       56      +42     
  Partials       11       11
Impacted Files Coverage Δ
usecase/tenantd.go 95.23% <100%> (ø) ⬆️
main.go 36.36% <36.36%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7b4084...18f1f95. Read the comment docs.

@WindzCUHK
Copy link
Contributor Author

Still got the error

# github.com/yahoojapan/athenz-client-sidecar
loadinternal: cannot find runtime/cgo

Tried but not works:

  1. apk add musl-dev

P.S. Set CGO_ENABLED=0 can build without having the error, but the binary size will get bigger

@WindzCUHK
Copy link
Contributor Author

docker output

export TAG=1.2.33333

with version

# docker build --build-arg APP_VERSION=${TAG} -t yahoojapan/athenz-client-sidecar:latest .
2020-01-28 02:53:30	[INFO]:	athenz clientd version -> 1.2.33333 at 20200128-025155 by go1.13.6 linux/amd64
2020-01-28 02:53:30	[INFO]:	athenz clientd config version -> v1.0.0

without version

# docker build -t yahoojapan/athenz-client-sidecar:latest .
2020-01-28 02:55:34	[INFO]:	athenz clientd version -> development version at 20200128-025408 by go1.13.6 linux/amd64
2020-01-28 02:55:34	[INFO]:	athenz clientd config version -> v1.0.0
# run docker
docker run --rm yahoojapan/athenz-client-sidecar:latest -version
# run go
docker run -it --rm golang:1.13-alpine sh

@WindzCUHK WindzCUHK changed the title [WIP] add go binary version during build time [patch] add go binary version during build time Jan 28, 2020
@kyfujisa kyfujisa merged commit 8185fd2 into master Jan 30, 2020
@WindzCUHK WindzCUHK deleted the add-go-binary-version branch January 30, 2020 04:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants