mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-10 01:10:29 +08:00
更新编译脚本
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
*_plus.go
|
*_plus.go
|
||||||
|
*-plus.sh
|
||||||
@@ -6,6 +6,7 @@ function build() {
|
|||||||
DIST=$ROOT/"../dist/${NAME}"
|
DIST=$ROOT/"../dist/${NAME}"
|
||||||
OS=${1}
|
OS=${1}
|
||||||
ARCH=${2}
|
ARCH=${2}
|
||||||
|
TAG=${3}
|
||||||
|
|
||||||
if [ -z $OS ]; then
|
if [ -z $OS ]; then
|
||||||
echo "usage: build.sh OS ARCH"
|
echo "usage: build.sh OS ARCH"
|
||||||
@@ -15,9 +16,12 @@ function build() {
|
|||||||
echo "usage: build.sh OS ARCH"
|
echo "usage: build.sh OS ARCH"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
if [ -z $TAG ]; then
|
||||||
|
TAG="community"
|
||||||
|
fi
|
||||||
|
|
||||||
VERSION=$(lookup-version $ROOT/../internal/const/const.go)
|
VERSION=$(lookup-version $ROOT/../internal/const/const.go)
|
||||||
ZIP="${NAME}-${OS}-${ARCH}-v${VERSION}.zip"
|
ZIP="${NAME}-${OS}-${ARCH}-${TAG}-v${VERSION}.zip"
|
||||||
|
|
||||||
# check edge-api
|
# check edge-api
|
||||||
APINodeVersion=$(lookup-version $ROOT"/../../EdgeAPI/internal/const/const.go")
|
APINodeVersion=$(lookup-version $ROOT"/../../EdgeAPI/internal/const/const.go")
|
||||||
@@ -30,7 +34,7 @@ function build() {
|
|||||||
|
|
||||||
cd $ROOT"/../../EdgeAPI/build"
|
cd $ROOT"/../../EdgeAPI/build"
|
||||||
echo "=============================="
|
echo "=============================="
|
||||||
./build.sh $OS $ARCH
|
./build.sh $OS $ARCH $TAG
|
||||||
echo "=============================="
|
echo "=============================="
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
@@ -47,7 +51,7 @@ function build() {
|
|||||||
rm -f $DIST/web/tmp/*
|
rm -f $DIST/web/tmp/*
|
||||||
cp $ROOT/configs/server.template.yaml $DIST/configs/
|
cp $ROOT/configs/server.template.yaml $DIST/configs/
|
||||||
|
|
||||||
EDGE_API_ZIP_FILE=$ROOT"/../../EdgeAPI/dist/edge-api-${OS}-${ARCH}-v${APINodeVersion}.zip"
|
EDGE_API_ZIP_FILE=$ROOT"/../../EdgeAPI/dist/edge-api-${OS}-${ARCH}-${TAG}-v${APINodeVersion}.zip"
|
||||||
cp $EDGE_API_ZIP_FILE $DIST/
|
cp $EDGE_API_ZIP_FILE $DIST/
|
||||||
cd $DIST/
|
cd $DIST/
|
||||||
unzip -q $(basename $EDGE_API_ZIP_FILE)
|
unzip -q $(basename $EDGE_API_ZIP_FILE)
|
||||||
@@ -56,7 +60,7 @@ function build() {
|
|||||||
|
|
||||||
# build
|
# build
|
||||||
echo "building "${NAME}" ..."
|
echo "building "${NAME}" ..."
|
||||||
env GOOS=$OS GOARCH=$GOARCH go build -ldflags="-s -w" -o $DIST/bin/${NAME} $ROOT/../cmd/edge-admin/main.go
|
env GOOS=$OS GOARCH=$GOARCH go build -tags $TAG -ldflags="-s -w" -o $DIST/bin/${NAME} $ROOT/../cmd/edge-admin/main.go
|
||||||
|
|
||||||
# delete hidden files
|
# delete hidden files
|
||||||
find $DIST -name ".DS_Store" -delete
|
find $DIST -name ".DS_Store" -delete
|
||||||
@@ -88,4 +92,4 @@ function lookup-version() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
build $1 $2
|
build $1 $2 $3
|
||||||
|
|||||||
Reference in New Issue
Block a user