forked from vmware-tanzu/tanzu-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-release-artifacts.sh
executable file
·52 lines (34 loc) · 1.44 KB
/
test-release-artifacts.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
#!/bin/bash
# Copyright 2021 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# Script to test release artifacts on MacOS and Linux OS
# Inspired by - https://github.com/vmware-tanzu/community-edition/blob/main/test/release-build-test/check-release-build.sh
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace
version="${1:?Tanzu-Framework version argument empty. Example usage: ./hack/test-release-artifacts.sh v0.10.0}"
: "${GITHUB_TOKEN:?GITHUB_TOKEN is not set}"
TF_REPO_URL="https://github.com/vmware-tanzu/tanzu-framework"
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH="amd64"
temp_dir=$(mktemp -d)
TF_TAR_BALL="${temp_dir}/tanzu-framework-${OS}-${ARCH}.tar.gz"
TF_INSTALLATION_DIR="${temp_dir}/tanzu-framework-${OS}-${ARCH}"
gh release download "${version}" --repo ${TF_REPO_URL} --pattern "tanzu-framework-${OS}-${ARCH}.tar.gz" --dir "${temp_dir}"
mkdir "${temp_dir}"/tanzu && tar xvzf "${TF_TAR_BALL}" --directory "${temp_dir}" -C tanzu
if [ "${OS}" == 'darwin' ]; then
for binary in "${temp_dir}"/tanzu/cli/*; do
if [[ -d "${binary}" ]]; then
spctl -vv --type install --asses "${binary}"/"${version}"/*
fi
done
fi
./hack/install.sh "${temp_dir}/tanzu/cli/core/${version}/tanzu-core-${OS}_${ARCH}" "${version}"
tanzu version
tanzu management-cluster version
tanzu package version
tanzu secret version
tanzu login version
tanzu pinniped-auth version
tanzu isolated-cluster version