代码拉取完成,页面将自动刷新
同步操作将从 DiDi-opensource/GateKeeper 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#! bin/bash
function build_linux() {
echo =================================
echo ==========Build Linux ======
echo =================================
CGO_ENABLED=0
GOOS=linux
GOARCH=amd64
echo now the CGO_ENABLED:
go env CGO_ENABLED
echo now the GOOS:
go env GOOS
echo now the GOARCH:
go env GOARCH
go build -o "${build_path}/${bin_file}" main.go
}
function build_mac() {
echo =================================
echo ==========Build Mac ======
echo =================================
CGO_ENABLED=0
GOOS=darwin
GOARCH=amd64
echo now the CGO_ENABLED:
go env CGO_ENABLED
echo now the GOOS:
go env GOOS
echo now the GOARCH:
go env GOARCH
go build -o "${build_path}/${bin_file}" main.go
}
function build_windows() {
echo =================================
echo ==========Build Windows ======
echo =================================
CGO_ENABLED=1
GOOS=windows
GOARCH=amd64
echo now the CGO_ENABLED:
go env CGO_ENABLED
echo now the GOOS:
go env GOOS
echo now the GOARCH:
go env GOARCH
bin_file="${bin_file}.exe"
go build -o "${build_path}/${bin_file}" main.go
}
function build() {
# get build os
build_os
if [ -d "build" ];then
rm -rf build
fi
build_workspace="${workspace}/build"
build_dir_name="gatekeeper-${version}-"
# build_dir_name="${workspace}/build/"
for os in ${arr_build_os[*]}
do
build_path="${build_workspace}/${build_dir_name}${os}"
echo $build_path
echo "create build dir ${build_path}"
mkdir -p "${build_path}/install"
cp -r conf "${build_path}"
cp -r dist "${build_path}"
cp control.sh "${build_path}"
cp gatekeeper.sql "${build_path}"
echo ==========Build Gatekeeper======
bin_file="gatekeeper"
build_${os}
echo ==========Build Gatekeeper install======
cd install
bin_file="install"
build_path="${build_path}/install"
build_${os}
cd -
echo "pack ${build_dir_name}${os}"
cd ${build_workspace}
tar -zcf "${build_dir_name}${os}.tar.gz" ${build_dir_name}${os}
cd -
done
}
function build_os() {
arr_build_os=("windows" "mac" "linux")
}
function main() {
# input git hub release version(1.0.1)
echo -n "Input gatekeeper release version(1.0.1):"
read -a version
version=`echo $version |grep -Eo '^[0-9]+.[0-9]+.[0-9]+$'`
if [ ! -n "$version" ];then
echo "input version error demo: (1.0.1)"
exit -1
fi
#set -x
set -e
# set go proxy
export GO111MODULE=on && export GOSUMDB=off
export GOPROXY=https://goproxy.cn
# set output dir path
workspace=`pwd`
# build bin
build
}
main
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。