mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
* Fix getting version of aliyun cli. It has a version sub command, and --version is used to specify product api version, not to get version of aliyun cli. * Change title of aliyun-cli
27 lines
1.0 KiB
Bash
27 lines
1.0 KiB
Bash
#!/bin/bash
|
|
################################################################################
|
|
## File: aliyun-cli.sh
|
|
## Desc: Installs Alibaba Cloud CLI
|
|
################################################################################
|
|
|
|
# Source the helpers for use with the script
|
|
source $HELPER_SCRIPTS/document.sh
|
|
source $HELPER_SCRIPTS/apt.sh
|
|
|
|
# Install Alibaba Cloud CLI
|
|
URL=$(curl -s https://api.github.com/repos/aliyun/aliyun-cli/releases/latest | jq -r '.assets[].browser_download_url | select(contains("aliyun-cli-linux"))')
|
|
wget -P /tmp $URL
|
|
tar xzvf /tmp/aliyun-cli-linux-*-amd64.tgz
|
|
mv aliyun /usr/local/bin
|
|
|
|
# Run tests to determine that the software installed as expected
|
|
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
|
if ! command -v aliyun ; then
|
|
echo "aliyun was not installed"
|
|
exit 1
|
|
fi
|
|
|
|
# Document what was added to the image
|
|
aliyun_version="$(aliyun version)"
|
|
echo "Lastly, documenting what we added to the metadata file"
|
|
DocumentInstalledItem "Alibaba Cloud CLI ($aliyun_version)" |