Matteo Scandolo | 89c5854 | 2021-10-27 15:48:04 -0700 | [diff] [blame^] | 1 | // This keyword will install the voltctl based on the branch (e.g.: voltha-2.8 or master) |
Hardik Windlass | 9658cd2 | 2021-10-25 11:13:25 +0000 | [diff] [blame] | 2 | def 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 | } |