添加 appBuildDate

This commit is contained in:
bjdgyc
2024-02-21 18:38:38 +08:00
parent ff07c81401
commit bbb9cfda67
7 changed files with 64 additions and 66 deletions

View File

@@ -8,7 +8,7 @@ if [[ $CN == "yes" ]]; then
export GOPROXY=https://goproxy.cn
fi
apk add build-base tzdata gcc musl-dev upx
apk add build-base tzdata gcc g++ musl musl-dev upx
uname -a
env
@@ -20,12 +20,10 @@ go mod tidy
echo "start build"
extldflags="-static"
ldflags="-s -w -X main.appVer=$appVer -X main.commitId=$commitId -X main.buildDate=$(date -Iseconds) \
-extldflags \"$extldflags\" "
ldflags="-s -w -X main.appVer=$appVer -X main.commitId=$commitId -X main.buildDate=$(date -Iseconds) -extldflags '-static' "
export CGO_ENABLED=1
go build -o anylink -trimpath -ldflags "$ldflags"
go build -v -o anylink -trimpath -ldflags "$ldflags"
ls -lh /server/

View File

@@ -8,7 +8,7 @@ if [[ $CN == "yes" ]]; then
export GOPROXY=https://goproxy.cn
fi
#兼容老版 iptables
# alpine:3.19 兼容老版 iptables
apk add --no-cache iptables iptables-legacy
rm /sbin/iptables
ln -s /sbin/iptables-legacy /sbin/iptables