代码拉取完成,页面将自动刷新
同步操作将从 辛佳雨/NoticeServices 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/sh
BuildVersion=`git describe --abbrev=0 --tags`
BuildTime=`date +%FT%T%z`
CommitID=`git rev-parse HEAD`
function help() {
echo "$0 linux|windows|mac"
}
function linux(){
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=x86_64-linux-musl-gcc CGO_LDFLAGS="-static" go build -a -ldflags "-w -s -X main.BuildVersion=${BuildVersion} -X main.CommitID=${CommitID} -X main.BuildTime=${BuildTime}"
copyFile
cp curl.sh bin/
cp NoticeServices bin/
rm -f NoticeServices
}
function windows(){
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc go build -ldflags "-w -s -X main.BuildVersion=${BuildVersion} -X main.CommitID=${CommitID} -X main.BuildTime=${BuildTime}"
copyFile
cp NoticeServices.exe bin/
rm -f NoticeServices.exe
}
function mac(){
go build -ldflags "-w -s -X main.BuildVersion=${BuildVersion} -X main.CommitID=${CommitID} -X main.BuildTime=${BuildTime}"
copyFile
cp curl.sh bin/
cp NoticeServices bin/
rm -f NoticeServices
}
function copyFile() {
echo "主程序编译完成"
rm -rf bin
mkdir bin
cp -r document/. bin/document/
cp -r template/. bin/template/
cp -r public/. bin/public/
cp -r config/. bin/config/
cp -r db/. bin/db/
plugin
}
function plugin() {
cd ./plugins
./build.sh
cd ../
mkdir bin/plugins
mkdir bin/plugins/mail
mkdir bin/plugins/webhook
cp plugins/mail/mail.so bin/plugins/mail
cp plugins/webhook/webhook.so bin/plugins/webhook
cp plugins/mail/config.toml bin/plugins/mail
cp plugins/webhook/config.toml bin/plugins/webhook
rm -f plugins/mail/mail.so
rm -f plugins/webhook/webhook.so
}
if [ "$1" == "" ]; then
help
elif [ "$1" == "linux" ];then
linux
elif [ "$1" == "windows" ];then
windows
elif [ "$1" == "mac" ];then
mac
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。