mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[ubuntu] Move aws-sam-cli installation to the aws.sh script (#3401)
This commit is contained in:
@@ -1,28 +0,0 @@
|
|||||||
#!/bin/bash -e
|
|
||||||
################################################################################
|
|
||||||
## File: aws-sam-cli.sh
|
|
||||||
## Desc: Installs AWS SAM CLI
|
|
||||||
## Requires Python >=3.6, must be run as non-root user after toolset installation
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# Source the helpers for use with the script
|
|
||||||
source $HELPER_SCRIPTS/install.sh
|
|
||||||
|
|
||||||
# Download latest aws sam cli sources
|
|
||||||
TarballUrl=$(curl -s https://api.github.com/repos/aws/aws-sam-cli/releases/latest | jq -r '.tarball_url')
|
|
||||||
TarballPath="/tmp/aws-sam-cli.tar.gz"
|
|
||||||
download_with_retries $TarballUrl "/tmp" "aws-sam-cli.tar.gz"
|
|
||||||
tar -xzf $TarballPath -C /tmp
|
|
||||||
cd /tmp/aws-aws-sam-cli*
|
|
||||||
|
|
||||||
mkdir /opt/python-aws-sam-cli
|
|
||||||
cp -r /opt/hostedtoolcache/Python/3.7* /opt/python-aws-sam-cli
|
|
||||||
|
|
||||||
# Use copy of python 3.7 from toolcache to install aws sam, setuptools package required for the installation
|
|
||||||
Python3Dir=$(echo /opt/python-aws-sam-cli/3.7*/x64)
|
|
||||||
Python3BinDir="${Python3Dir}/bin"
|
|
||||||
$Python3BinDir/python3 -m pip install setuptools
|
|
||||||
$Python3BinDir/python3 setup.py install
|
|
||||||
ln -sf ${Python3BinDir}/sam /usr/local/bin/sam
|
|
||||||
|
|
||||||
invoke_tests "CLI.Tools" "AWS SAM CLI"
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: aws.sh
|
## File: aws.sh
|
||||||
## Desc: Installs the AWS CLI
|
## Desc: Installs the AWS CLI, Session Manager plugin for the AWS CLI, and AWS SAM CLI
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Source the helpers for use with the script
|
# Source the helpers for use with the script
|
||||||
@@ -24,4 +24,11 @@ fi
|
|||||||
download_with_retries "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" "/tmp" "session-manager-plugin.deb"
|
download_with_retries "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" "/tmp" "session-manager-plugin.deb"
|
||||||
apt install /tmp/session-manager-plugin.deb
|
apt install /tmp/session-manager-plugin.deb
|
||||||
|
|
||||||
|
# Download & install the latest aws sam cli release
|
||||||
|
zipName="aws-sam-cli-linux-x86_64.zip"
|
||||||
|
zipUrl="https://github.com/aws/aws-sam-cli/releases/latest/download/${zipName}"
|
||||||
|
download_with_retries $zipUrl "/tmp" $zipName
|
||||||
|
unzip /tmp/${zipName} -d /tmp
|
||||||
|
/tmp/install
|
||||||
|
|
||||||
invoke_tests "CLI.Tools" "AWS"
|
invoke_tests "CLI.Tools" "AWS"
|
||||||
|
|||||||
@@ -25,9 +25,7 @@ Describe "AWS" {
|
|||||||
It "Session Manager Plugin for the AWS CLI" {
|
It "Session Manager Plugin for the AWS CLI" {
|
||||||
session-manager-plugin | Out-String | Should -Match "plugin was installed successfully"
|
session-manager-plugin | Out-String | Should -Match "plugin was installed successfully"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Describe "AWS SAM CLI" {
|
|
||||||
It "AWS SAM CLI" {
|
It "AWS SAM CLI" {
|
||||||
"sam --version" | Should -ReturnZeroExitCode
|
"sam --version" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -223,10 +223,6 @@
|
|||||||
"package": "yamllint",
|
"package": "yamllint",
|
||||||
"cmd": "yamllint"
|
"cmd": "yamllint"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"package": "aws-sam-cli",
|
|
||||||
"cmd": "sam"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"package": "ansible-base",
|
"package": "ansible-base",
|
||||||
"cmd": "ansible"
|
"cmd": "ansible"
|
||||||
|
|||||||
@@ -223,10 +223,6 @@
|
|||||||
"package": "yamllint",
|
"package": "yamllint",
|
||||||
"cmd": "yamllint"
|
"cmd": "yamllint"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"package": "aws-sam-cli",
|
|
||||||
"cmd": "sam"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"package": "ansible-base",
|
"package": "ansible-base",
|
||||||
"cmd": "ansible"
|
"cmd": "ansible"
|
||||||
|
|||||||
@@ -265,16 +265,6 @@
|
|||||||
],
|
],
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} pwsh -f {{ .Path }}'"
|
"execute_command": "sudo sh -c '{{ .Vars }} pwsh -f {{ .Path }}'"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "shell",
|
|
||||||
"scripts": [
|
|
||||||
"{{template_dir}}/scripts/installers/aws-sam-cli.sh"
|
|
||||||
],
|
|
||||||
"environment_vars": [
|
|
||||||
"HELPER_SCRIPTS={{user `helper_script_folder`}}"
|
|
||||||
],
|
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"scripts": [
|
"scripts": [
|
||||||
|
|||||||
Reference in New Issue
Block a user