代码拉取完成,页面将自动刷新
#! /bin/bash
GIT_COMMIT=$(git rev-parse HEAD)
GIT_SHA=$(git rev-parse --short HEAD)
GIT_TAG=$(git describe --tags --abbrev=0 --exact-match 2>/dev/null )
GIT_DIRTY=$(test -n "`git status --porcelain`" && echo "dirty" || echo "clean")
VERSION_METADATA=unreleased
VERSION=latest
# Clear the "unreleased" string in BuildMetadata
if [[ -n $GIT_TAG ]]
then
VERSION_METADATA=
VERSION=${GIT_TAG}
fi
LDFLAGS="-X github.com/kubesphere/kubekey/version.version=${VERSION}
-X github.com/kubesphere/kubekey/version.metadata=${VERSION_METADATA}
-X github.com/kubesphere/kubekey/version.gitCommit=${GIT_COMMIT}
-X github.com/kubesphere/kubekey/version.gitTreeState=${GIT_DIRTY}"
if [ -n "$1" ]; then
if [ "$1" == "-p" ] || [ "$1" == "--proxy" ]; then
# Using the most trusted Go module proxy in China
docker run --rm -e GO111MODULE=on -e GOPROXY=https://goproxy.cn -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.14.7 go build -ldflags "$LDFLAGS" -v -o output/kk
else
echo "The option should be '-p' or '--proxy'"
fi
else
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.14.7 go build -ldflags "$LDFLAGS" -v -o output/kk
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。