@@ -18,10 +18,6 @@ set -o errexit
18
18
set -o nounset
19
19
set -o pipefail
20
20
21
- # With the recent ibmcloud have seen panic and need this environment set to avoid this panic, for more information
22
- # refer the Notes section in https://github.com/IBM-Cloud/ibm-cloud-cli-release/releases/tag/v2.11.0.
23
- export LANG=en_US.UTF-8
24
-
25
21
REPO_ROOT=$( dirname " ${BASH_SOURCE[0]} " ) /..
26
22
cd " ${REPO_ROOT} " || exit 1
27
23
GOPATH_BIN=" $( go env GOPATH) /bin/"
@@ -38,28 +34,44 @@ ARTIFACTS="${ARTIFACTS:-${PWD}/_artifacts}"
38
34
mkdir -p " ${ARTIFACTS} /logs/"
39
35
40
36
ARCH=$( uname -m)
37
+ OS=$( uname -s)
38
+ IBMCLOUD_CLI_VERSION=${IBMCLOUD_CLI_VERSION:- " 2.12.0" }
41
39
PVSADM_VERSION=${PVSADM_VERSION:- " v0.1.7" }
42
40
E2E_FLAVOR=${E2E_FLAVOR:- }
43
41
REGION=${REGION:- " us-south" }
44
42
43
+ [ " ${ARCH} " == " x86_64" ] && ARCH=" amd64"
44
+
45
45
trap cleanup EXIT
46
46
47
47
cleanup (){
48
48
# stop the boskos heartbeat
49
49
[[ -z ${HEART_BEAT_PID:- } ]] || kill -9 " ${HEART_BEAT_PID} " || true
50
50
}
51
51
52
+ # Installing binaries from github releases
52
53
install_pvsadm (){
53
- [ " ${ARCH} " == " x86_64 " ] && ARCH= " amd64 "
54
+ platform= " $( echo ${OS} | tr ' [:upper:] ' ' [:lower:] ' ) - ${ ARCH} "
54
55
55
- # Installing binaries from github releases
56
- curl -fsL https://github.com/ppc64le-cloud/pvsadm/releases/download/${PVSADM_VERSION} /pvsadm-linux-${ARCH} -o pvsadm
56
+ curl -fsL https://github.com/ppc64le-cloud/pvsadm/releases/download/${PVSADM_VERSION} /pvsadm-${platform} -o pvsadm
57
57
chmod +x ./pvsadm
58
58
}
59
59
60
+ install_ibmcloud_cli (){
61
+ if [ ${OS} == " Linux" ]; then
62
+ platform=" linux-${ARCH} "
63
+ elif [ ${OS} == " Darwin" ]; then
64
+ platform=" macos"
65
+ fi
66
+
67
+ curl https://download.clis.cloud.ibm.com/ibm-cloud-cli/${IBMCLOUD_CLI_VERSION} /binaries/IBM_Cloud_CLI_${IBMCLOUD_CLI_VERSION} _${platform} .tgz -o IBM_Cloud_CLI_${IBMCLOUD_CLI_VERSION} _${platform} .tgz
68
+ tar -xf IBM_Cloud_CLI_${IBMCLOUD_CLI_VERSION} _${platform} .tgz
69
+ install IBM_Cloud_CLI/ibmcloud /usr/local/bin
70
+
71
+ }
72
+
60
73
create_powervs_network_instance (){
61
- # Install ibmcloud CLI tool
62
- curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
74
+ install_ibmcloud_cli
63
75
64
76
# Login to IBM Cloud using the API Key
65
77
ibmcloud login -a cloud.ibm.com -r ${REGION}
@@ -93,7 +105,7 @@ prerequisites_powervs(){
93
105
# Assigning PowerVS variables
94
106
export IBMPOWERVS_SSHKEY_NAME=${IBMPOWERVS_SSHKEY_NAME:- " powercloud-bot-key" }
95
107
export IBMPOWERVS_IMAGE_NAME=${IBMPOWERVS_IMAGE_NAME:- " capibm-powervs-centos-streams8-1-24-2" }
96
- export IBMPOWERVS_SERVICE_INSTANCE_ID=${BOSKOS_RESOURCE_ID:- " 0f28d13a-6e33-4d86-b6d7-a9b46ff7659e " }
108
+ export IBMPOWERVS_SERVICE_INSTANCE_ID=${BOSKOS_RESOURCE_ID:- " d53da3bf-1f4a-42fa-9735-acf16b1a05cd " }
97
109
export IBMPOWERVS_NETWORK_NAME=" capi-net-$( cat /dev/urandom | tr -dc ' a-zA-Z0-9' | head --bytes 5) "
98
110
# Setting controller loglevel to allow debug logs from the PowerVS client
99
111
export LOGLEVEL=5
0 commit comments