-
Notifications
You must be signed in to change notification settings - Fork 113
/
release-version.sh
executable file
·55 lines (44 loc) · 1.67 KB
/
release-version.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env sh
set -e
VERSION=$1
if [ "$VERSION" = "" ]; then
echo "please specify version"
exit 1
else
echo "Version=$VERSION"
fi
DIR=$(dirname $(realpath $0))
BIN="${DIR}/bin"
# build images
# aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/vanus
# make docker-push IMAGE_TAG="${VERSION}"
# make docker-push IMAGE_TAG="${VERSION}" DOCKER_REGISTRY=linkall.tencentcloudcr.com
# build vsctl
echo "Building vsctl..."
rm -rf "${BIN}/vsctl/${VERSION}"
for os in "linux" "darwin"; do
for arch in "amd64" "arm64"; do
echo "Building vsctl for ${os}/${arch}..."
mkdir -p "${BIN}/vsctl/${VERSION}/${os}-${arch}"
make build-vsctl GOOS="${os}" GOARCH="${arch}" VERSION="${VERSION}" CMD_OUTPUT_DIR="${BIN}/vsctl/${VERSION}/${os}-${arch}"
done
done
# update latest
echo "Updating latest vsctl"
rm -rf "${BIN}/vsctl/latest"
cp -r "${BIN}/vsctl/${VERSION}" "${BIN}/vsctl/latest"
echo "Building vsctl is done"
# build k8s yaml file
# echo "Generating Kubernetes YAML files"
# cp "${BIN}"/all-in-one/template.yml "${BIN}"/all-in-one/"$VERSION".yml
# sed -i "s/:<version>/:${VERSION}/g" "${BIN}"/all-in-one/"$VERSION".yml
# cp "${BIN}"/all-in-one/template.cn.yml "${BIN}"/all-in-one/"$VERSION".cn.yml
# sed -i "s/:<version>/:${VERSION}/g" "${BIN}"/all-in-one/"$VERSION".cn.yml
# update latest
# echo "Updating Kubernetes YAML files"
# rm "${BIN}"/all-in-one/latest.yml
# cp "${BIN}"/all-in-one/"$VERSION".yml "${BIN}"/all-in-one/latest.yml
# rm "${BIN}"/all-in-one/latest.cn.yml
# cp "${BIN}"/all-in-one/"$VERSION".cn.yml "${BIN}"/all-in-one/latest.cn.yml
# echo "Generating is done"
echo "Release Vanus $VERSION is completed."