blob: d81c9ed3355c2da981f933c446c292107a77db67 [file] [log] [blame]
Hardik Windlass9658cd22021-10-25 11:13:25 +00001# This keyword will install the voltctl based on the branch (e.g.: voltha-2.8 or master)
2def call(String branch) {
3 sh returnStdout: false, script: """
4 mkdir -p $WORKSPACE/bin
5 cd $WORKSPACE
6 if [ "${branch}" == "voltha-2.8" ]; then
7 VOLTCTL_VERSION=1.6.11
8 else
9 VOLTCTL_VERSION=\$(curl -sSL https://api.github.com/repos/opencord/voltctl/releases/latest | jq -r .tag_name | sed -e 's/^v//g')
10 fi
11 HOSTOS=\$(uname -s | tr "[:upper:]" "[:lower:"])
12 HOSTARCH=\$(uname -m | tr "[:upper:]" "[:lower:"])
13 if [ \$HOSTARCH == "x86_64" ]; then
14 HOSTARCH="amd64"
15 fi
16 curl -o $WORKSPACE/bin/voltctl -sSL https://github.com/opencord/voltctl/releases/download/v\${VOLTCTL_VERSION}/voltctl-\${VOLTCTL_VERSION}-\${HOSTOS}-\${HOSTARCH}
17 chmod 755 $WORKSPACE/bin/voltctl
18 voltctl version --clientonly
19 """
20}