1 Star 0 Fork 0

CCUU / teleport

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
version.mk 2.15 KB
一键复制 编辑 原始数据 按行查看 历史
GITREF=$(shell git describe --long --tags)
# $(API_VERSION_GO) will be written to api/version.go
API_VERSION_GO="// Code generated by \"make version\". DO NOT EDIT.\n\
package api\n\n\
import \"github.com/coreos/go-semver/semver\"\n\n\
const Version = \"$(VERSION)\"\n\n\
var SemVersion = semver.New(Version)\n\n"
# $(GITREF_GO) will be written to gitref.go
GITREF_GO="// Code generated by \"make version\". DO NOT EDIT.\n\
package teleport\n\n\
func init() { Gitref = \"$(GITREF)\" }\n"
#
# setver updates version.go and gitref.go with VERSION and GITREF vars
#
.PHONY:setver
setver: validate-semver helm-version tsh-version
@printf $(API_VERSION_GO) | gofmt > ./api/version.go
@printf $(GITREF_GO) | gofmt > gitref.go
# helm-version automatically updates the versions of Helm charts to match the version set in the Makefile,
# so that chart versions are also kept in sync when the Teleport version is updated for a release.
# If the version contains '-dev' (as it does on the master branch, or for development builds) then we get the latest
# published major version number by parsing a sorted list of git tags instead, to make deploying the chart from master
# work as expected. Version numbers are quoted as a string because Helm otherwise treats dotted decimals as floats.
# The weird -i usage is to make the sed commands work the same on both Linux and Mac. Test on both platforms if you change it.
.PHONY:helm-version
helm-version:
for CHART in teleport-cluster teleport-kube-agent teleport-cluster/charts/teleport-operator; do \
sed -i'.bak' -e "s_^\\.version:\ .*_.version: \\&version \"$${VERSION}\"_g" examples/chart/$${CHART}/Chart.yaml || exit 1; \
rm -f examples/chart/$${CHART}/Chart.yaml.bak; \
done
TSH_APP_PLISTS := $(wildcard build.assets/macos/*/tsh.app/Contents/Info.plist)
PLIST_FILES := $(abspath $(TSH_APP_PLISTS))
# tsh-version sets CFBundleVersion and CFBundleShortVersionString in the tsh{,dev} Info.plist
.PHONY:tsh-version
tsh-version:
cd build.assets/tooling && go run ./cmd/update-plist-version $(VERSION) $(PLIST_FILES)
.PHONY:validate-semver
validate-semver:
cd build.assets/tooling && CGO_ENABLED=0 go run ./cmd/check -check valid -tag v$(VERSION)
1
https://gitee.com/ccuuwb/teleport.git
git@gitee.com:ccuuwb/teleport.git
ccuuwb
teleport
teleport
master

搜索帮助