代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/OpenEdge 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/sh
#
set -e
while [ -n "$1" ]
do
case "$1" in
-v)version=$2
shift ;;
esac
shift
done
version_info="package version\n\n// Version the version of this binary\nconst Version = \"$version\""
echo $version_info > version/version.go
go_version=`go version | awk '{print substr($3, 3)}'`
echo "Current golang version is $go_version, the minimum version of go required is 1.10.0"
# Use `godep restore ./...` checkout dependencies
find $GOPATH/src/github.com/docker -path '*/vendor' -type d | xargs -IX rm -r X
if [ -d output ]; then
rm -rf output/*
fi
mkdir -p output
build() {
TAG=$1
GOOS=$2
GOARCH=$3
CGOCC=$4
echo "\nBuild $TAG with GOOS=$GOOS GOARCH=$GOARCH CGOCC=$CGOCC"
if [ $GOOS = "windows" ];then
GOEXE=".exe"
else
GOEXE=""
fi
if [ -d output/$TAG ]; then
rm -rf output/$TAG
fi
mkdir -p output/$TAG
# docker release for multiple cpu && os
tar cf - -C example/docker . | tar xf - -C output/$TAG
# native release for multiple cpu && os(enable comment script below)
# tar cf - -C example/native . | tar xf - -C output/$TAG
# engine
env GOOS=$GOOS GOARCH=$GOARCH go build -o output/$TAG/bin/openedge$GOEXE ./cmd
# modules
# env GOOS=$GOOS GOARCH=$GOARCH go build -o output/$TAG/bin/openedge_hub$GOEXE ./module/hub/cmd
# env GOOS=$GOOS GOARCH=$GOARCH go build -o output/$TAG/bin/openedge_function$GOEXE ./module/function/cmd
# env GOOS=$GOOS GOARCH=$GOARCH go build -o output/$TAG/bin/openedge_remote_mqtt$GOEXE ./module/remote/mqtt
# function runtime python2.7
# cp module/function/runtime/python2.7/*.py output/$TAG/bin/
# chmod +x output/$TAG/bin/openedge_function_runtime_python2.7.py
cd output/$TAG/
tar czvf ../openedge-$TAG-$version.tar.gz *
cd ../../
}
# build for multiple cpu && os, if for windows, please install `mingw` first
build "linux-x86" "linux" "386" "cc"
build "linux-x86_64" "linux" "amd64" "cc"
build "linux-armv7" "linux" "arm" "cc"
build "linux-aarch64" "linux" "arm64" "cc"
build "windows10-x86" "windows" "386" "i686-w64-mingw32-gcc"
build "windows10-x86_64" "windows" "amd64" "x86_64-w64-mingw32-gcc"
# must be built on MacOS
# build "darwin-x86_64" "darwin" "amd64" "cc"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。