Skip to content

Commit

Permalink
chore:add env field build value
Browse files Browse the repository at this point in the history
  • Loading branch information
geebytes committed May 7, 2024
1 parent 358ba6f commit 182d806
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
mkdir -p /tmp/protos
git clone https://github.com/begonia-org/protos.git /tmp/protos
- name: Test
run: go test -v -gcflags=-l -coverprofile=coverage.txt -covermode=atomic -ldflags -X=github.com/begonia-org/begonia.Version=$(git describe --tags --abbrev=0)\ -X=github.com/begonia-org/begonia.BuildTime=$(date '+%Y%m%d%H%M%S')\ -X=github.com/begonia-org/begonia.Commit=$(git rev-parse --short HEAD) ./internal/integration
run: go test -v -gcflags=-l -coverprofile=coverage.txt -covermode=atomic -ldflags -X=github.com/begonia-org/begonia.Version=$(git describe --tags --abbrev=0)\ -X=github.com/begonia-org/begonia.BuildTime=$(date '+%Y%m%d%H%M%S')\ -X=github.com/begonia-org/begonia.Commit=$(git rev-parse --short HEAD)\ -X=github.com/begonia-org/begonia.Env=test ./internal/integration

- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
7 changes: 6 additions & 1 deletion internal/integration/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"
"time"

"github.com/begonia-org/begonia"
"github.com/begonia-org/begonia/config"
"github.com/begonia-org/begonia/internal"
"github.com/begonia-org/begonia/internal/pkg/logger"
Expand Down Expand Up @@ -35,7 +36,11 @@ func runExampleServer() {
func RunTestServer() {
log.Printf("run test server")
onceServer.Do(func() {
config := config.ReadConfig("dev")
env:="dev"
if begonia.Env!=""{
env=begonia.Env
}
config := config.ReadConfig(env)
go func() {

worker := internal.New(config, logger.Log, "0.0.0.0:12140")
Expand Down
3 changes: 2 additions & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ var (
Version string
BuildTime string
Commit string
)
Env string
)

0 comments on commit 182d806

Please sign in to comment.