mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
fix build.
This commit is contained in:
parent
d9403d9c14
commit
0cebe465a2
@ -17,5 +17,9 @@ fi
|
|||||||
|
|
||||||
docker run --rm -it \
|
docker run --rm -it \
|
||||||
-v "${PWD}/../server:/src" \
|
-v "${PWD}/../server:/src" \
|
||||||
--entrypoint="go" \
|
-e GIT_COMMIT=`git rev-parse --short HEAD` \
|
||||||
neko_dev_server build -o "bin/neko" "cmd/neko/main.go"
|
-e GIT_BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD` \
|
||||||
|
-e GIT_DIRTY=`git diff-index --quiet HEAD -- || echo "✗-"` \
|
||||||
|
--entrypoint="bash" \
|
||||||
|
--workdir="/src" \
|
||||||
|
neko_dev_server ./build
|
||||||
|
16
server/build
16
server/build
@ -3,8 +3,22 @@
|
|||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
BUILD_TIME=`date -u +'%Y-%m-%dT%H:%M:%SZ'`
|
BUILD_TIME=`date -u +'%Y-%m-%dT%H:%M:%SZ'`
|
||||||
|
|
||||||
|
#
|
||||||
|
# set git build variables if git exists
|
||||||
|
if git status > /dev/null 2>&1 && [ -z $GIT_COMMIT ] && [ -z $GIT_BRANCH ] && [ -z $GIT_DIRTY ];
|
||||||
|
then
|
||||||
GIT_COMMIT=`git rev-parse --short HEAD`
|
GIT_COMMIT=`git rev-parse --short HEAD`
|
||||||
GIT_BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD`
|
GIT_BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD`
|
||||||
GIT_DIRTY=`git diff-index --quiet HEAD -- || echo "✗-"`
|
GIT_DIRTY=`git diff-index --quiet HEAD -- || echo "✗-"`
|
||||||
|
fi
|
||||||
|
|
||||||
go build -o bin/neko -ldflags "-s -X 'm1k1o/neko.buildDate=${BUILD_TIME}' -X 'm1k1o/neko.gitCommit=${GIT_DIRTY}${GIT_COMMIT}' -X 'm1k1o/neko.gitBranch=${GIT_BRANCH}'" -i cmd/neko/main.go
|
go build \
|
||||||
|
-o bin/neko \
|
||||||
|
-ldflags "
|
||||||
|
-s -w
|
||||||
|
-X 'm1k1o/neko.buildDate=${BUILD_TIME}'
|
||||||
|
-X 'm1k1o/neko.gitCommit=${GIT_DIRTY}${GIT_COMMIT}'
|
||||||
|
-X 'm1k1o/neko.gitBranch=${GIT_BRANCH}'
|
||||||
|
" \
|
||||||
|
cmd/neko/main.go;
|
||||||
|
Loading…
Reference in New Issue
Block a user