Skip to content

Commit

Permalink
parse githash from env during make
Browse files Browse the repository at this point in the history
  • Loading branch information
wey-gu committed Dec 1, 2022
1 parent 5c80a61 commit f06d994
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: build docker image
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name ?= nebula-console

# build with verison infos
buildDate = $(shell TZ=UTC date +%FT%T%z)
gitCommit = $(shell git log --pretty=format:'%h' -1)
gitCommit = ${GITHUB_SHA::7}
gitCommit ?= $(shell git log --pretty=format:'%h' -1)

ldflags="-w -X main.gitTag=${gitTag} -X main.buildDate=${buildDate} -X main.gitCommit=${gitCommit}"

Expand Down

0 comments on commit f06d994

Please sign in to comment.