mirror of
https://github.com/dalbodeule/hop-gate.git
synced 2025-12-12 14:50:09 +09:00
[feat](build): add versioned Docker image build script and version injection
- Introduced `tools/build_server_image.sh` for building versioned server images with support for multi-arch builds. - Added `VERSION` injection via `-ldflags` in Dockerfile and Go binaries for both server and client. - Updated workflows and Makefile to ensure consistent version tagging during builds.
This commit is contained in:
@@ -15,6 +15,10 @@ import (
|
||||
"github.com/dalbodeule/hop-gate/internal/proxy"
|
||||
)
|
||||
|
||||
// version 은 빌드 시 -ldflags "-X main.version=xxxxxxx" 로 덮어쓰이는 필드입니다.
|
||||
// 기본값 "dev" 는 로컬 개발용입니다.
|
||||
var version = "dev"
|
||||
|
||||
func getEnvOrPanic(logger logging.Logger, key string) string {
|
||||
value, exists := os.LookupEnv(key)
|
||||
if !exists || strings.TrimSpace(value) == "" {
|
||||
@@ -124,6 +128,7 @@ func main() {
|
||||
|
||||
logger.Info("hop-gate client starting", logging.Fields{
|
||||
"stack": "prometheus-loki-grafana",
|
||||
"version": version,
|
||||
"server_addr": finalCfg.ServerAddr,
|
||||
"domain": finalCfg.Domain,
|
||||
"local_target": finalCfg.LocalTarget,
|
||||
|
||||
Reference in New Issue
Block a user