Skip to content

Commit

Permalink
feat version info
Browse files Browse the repository at this point in the history
  • Loading branch information
a3510377 committed May 5, 2024
1 parent 0b0ec23 commit ed5ae4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache-new
# linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8
platforms: linux/amd64
build-args: GIT_COMMIT=${{ github.sha }}
build-args: |
GIT_COMMIT=${{ github.sha }}
GIT_BRANCH=${{ github.ref }}
- name: Move cache
run: |
Expand Down
8 changes: 8 additions & 0 deletions server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ import (
log "github.com/sirupsen/logrus"
)

// GIT_COMMIT and GIT_BRANCH are set by the build script
var (
GIT_BRANCH string = "-"
GIT_COMMIT string = "0000000"
)

func main() {
fmt.Printf("Server Version: %s (%s)\n", GIT_BRANCH, GIT_COMMIT)

CONFIG_PATH := os.Getenv("CONFIG_PATH")
if CONFIG_PATH == "" {
CONFIG_PATH = "data/api/config.yaml"
Expand Down

0 comments on commit ed5ae4f

Please sign in to comment.