mirror of
https://github.com/actions/runner-images.git
synced 2025-12-17 23:28:57 +00:00
Add Alibaba cloud aliyun-cli (#688)
* added aliyun cli to windows * added aliyun cli to Ubuntu Co-authored-by: Nikita Bykov <v-nibyko@microsoft.com>
This commit is contained in:
27
images/linux/scripts/installers/aliyun-cli.sh
Normal file
27
images/linux/scripts/installers/aliyun-cli.sh
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/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 | grep "Alibaba Cloud Command Line Interface Version" | cut -d " " -f 7)"
|
||||||
|
echo "Lastly, documenting what we added to the metadata file"
|
||||||
|
DocumentInstalledItem "Alibaba Cloud CLI ($aliyun_version)"
|
||||||
@@ -171,6 +171,7 @@
|
|||||||
"{{template_dir}}/scripts/installers/azure-cli.sh",
|
"{{template_dir}}/scripts/installers/azure-cli.sh",
|
||||||
"{{template_dir}}/scripts/installers/azure-devops-cli.sh",
|
"{{template_dir}}/scripts/installers/azure-devops-cli.sh",
|
||||||
"{{template_dir}}/scripts/installers/1604/basic.sh",
|
"{{template_dir}}/scripts/installers/1604/basic.sh",
|
||||||
|
"{{template_dir}}/scripts/installers/aliyun-cli.sh",
|
||||||
"{{template_dir}}/scripts/installers/aws.sh",
|
"{{template_dir}}/scripts/installers/aws.sh",
|
||||||
"{{template_dir}}/scripts/installers/build-essential.sh",
|
"{{template_dir}}/scripts/installers/build-essential.sh",
|
||||||
"{{template_dir}}/scripts/installers/nvm.sh",
|
"{{template_dir}}/scripts/installers/nvm.sh",
|
||||||
|
|||||||
@@ -174,6 +174,7 @@
|
|||||||
"{{template_dir}}/scripts/installers/azure-cli.sh",
|
"{{template_dir}}/scripts/installers/azure-cli.sh",
|
||||||
"{{template_dir}}/scripts/installers/azure-devops-cli.sh",
|
"{{template_dir}}/scripts/installers/azure-devops-cli.sh",
|
||||||
"{{template_dir}}/scripts/installers/1804/basic.sh",
|
"{{template_dir}}/scripts/installers/1804/basic.sh",
|
||||||
|
"{{template_dir}}/scripts/installers/aliyun-cli.sh",
|
||||||
"{{template_dir}}/scripts/installers/aws.sh",
|
"{{template_dir}}/scripts/installers/aws.sh",
|
||||||
"{{template_dir}}/scripts/installers/build-essential.sh",
|
"{{template_dir}}/scripts/installers/build-essential.sh",
|
||||||
"{{template_dir}}/scripts/installers/clang.sh",
|
"{{template_dir}}/scripts/installers/clang.sh",
|
||||||
|
|||||||
@@ -299,6 +299,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-Bazel.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-Bazel.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-AliyunCli.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"scripts":[
|
"scripts":[
|
||||||
@@ -731,6 +737,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Validate-Bazel.ps1"
|
"{{ template_dir }}/scripts/Installers/Validate-Bazel.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Validate-AliyunCli.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"scripts":[
|
"scripts":[
|
||||||
|
|||||||
@@ -578,6 +578,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-Bazel.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-Bazel.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-AliyunCli.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"scripts":[
|
"scripts":[
|
||||||
@@ -862,6 +868,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Validate-Bazel.ps1"
|
"{{ template_dir }}/scripts/Installers/Validate-Bazel.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Validate-AliyunCli.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "C:\\InstalledSoftware.md",
|
"source": "C:\\InstalledSoftware.md",
|
||||||
|
|||||||
6
images/win/scripts/Installers/Install-AliyunCli.ps1
Normal file
6
images/win/scripts/Installers/Install-AliyunCli.ps1
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: Install-AliyunCli.ps1
|
||||||
|
## Desc: Install Alibaba Cloud CLI
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
choco install aliyun-cli -y
|
||||||
24
images/win/scripts/Installers/Validate-AliyunCli.ps1
Normal file
24
images/win/scripts/Installers/Validate-AliyunCli.ps1
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: Validate-AliyunCli.ps1
|
||||||
|
## Desc: Validate Alibaba Cloud CLI
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
if (Get-Command -Name 'aliyun')
|
||||||
|
{
|
||||||
|
Write-Host "Alibaba Cloud CLI on path"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-Host 'Alibaba Cloud CLI is not on path'
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Adding description of the software to Markdown
|
||||||
|
$aliyun_version = ((aliyun --version | Select-String "Alibaba Cloud Command Line Interface Version ") -Split(" "))[6]
|
||||||
|
|
||||||
|
$SoftwareName = "Alibaba Cloud CLI"
|
||||||
|
$Description = @"
|
||||||
|
_Version:_ $aliyun_version<br/>
|
||||||
|
"@
|
||||||
|
|
||||||
|
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||||
Reference in New Issue
Block a user