Skip to content

Commit 8f90a0b

Browse files
committed
删除无用文件
1 parent ea24d1e commit 8f90a0b

File tree

5 files changed

+28
-445
lines changed

5 files changed

+28
-445
lines changed

build

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
11
#!/bin/sh
22

3-
VERSION=0.11.0
4-
5-
DOCKER_BUILDKIT=1 docker build -t natpass -f contrib/build/Dockerfile .
6-
docker run --rm \
7-
-v `pwd`:/build \
8-
-v $HOME/.cache/go-build:/root/.cache/go-build \
9-
-v $HOME/go/pkg/mod:/root/go/pkg/mod \
10-
-e BUILD_VERSION=$VERSION \
11-
natpass /build/contrib/build/build "$@"
3+
cd $(dirname $(realpath $0))/../../
4+
5+
BUILD_VERSION=${BUILD_VERSION:-0.0.0}
6+
7+
HASH=`git log -n1 --pretty=format:%h`
8+
REVERSION=`git log --oneline|wc -l|tr -d ' '`
9+
BUILD_TIME=`date +'%Y-%m-%d %H:%M:%S'`
10+
LDFLAGS="-X 'main.gitHash=$HASH'
11+
-X 'main.gitReversion=$REVERSION'
12+
-X 'main.buildTime=$BUILD_TIME'
13+
-X 'main.version=$BUILD_VERSION'"
14+
15+
if [ "$GOOS" = "windows" ]; then
16+
LDFLAGS="$LDFLAGS
17+
--extldflags '-static -fpic -lssp'"
18+
fi
19+
20+
go run contrib/bindata/main.go -pkg shell -o code/client/rule/shell/assets.go \
21+
-prefix html/shell "$@" html/shell/...
22+
go run contrib/bindata/main.go -pkg vnc -o code/client/rule/vnc/assets.go \
23+
-prefix html/vnc "$@" html/vnc/...
24+
go run contrib/bindata/main.go -pkg code -o code/client/rule/code/assets.go \
25+
-prefix html/code "$@" html/code/...
26+
go run contrib/bindata/main.go -pkg dashboard -o code/client/dashboard/assets.go \
27+
-prefix html/dashboard "$@" html/dashboard/...
28+
29+
go build -ldflags "$LDFLAGS" -o bin/np-svr code/server/*.go
30+
go build -ldflags "$LDFLAGS" -tags "$TAGS" -o bin/np-cli code/client/*.go

build_all

Lines changed: 0 additions & 11 deletions
This file was deleted.

contrib/build/Dockerfile

Lines changed: 0 additions & 33 deletions
This file was deleted.

contrib/build/build

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)