change installation method

This commit is contained in:
Mikhail Timofeev
2020-07-01 18:34:36 +03:00
parent 21c6325fca
commit b12baea320
4 changed files with 52 additions and 39 deletions

View File

@@ -2,15 +2,29 @@
################################################################################
## File: aws-sam-cli.sh
## Desc: Installs AWS SAM CLI
## Must be run as non-root user after homebrew and clang
## Must be run after toolset installation
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install aws sam cli
brew tap aws/tap
brew install aws-sam-cli
TarballUrl=$(curl -s https://api.github.com/repos/awslabs/aws-sam-cli/releases/latest | jq -r '.tarball_url')
TarballPath="/tmp/aws-sam-cli.tar.gz"
wget $TarballUrl -O $TarballPath
tar -xzvf $TarballPath -C /tmp
cd /tmp/awslabs-aws-sam-cli*
# Use python 3.7 from toolcache to install aws sam, setuptools module required for the installation
Python3Dir=$(echo ${AGENT_TOOLSDIRECTORY}/Python/3.7*/x64)
Python3BinDir=$(echo ${Python3Dir}/bin)
export PATH="$Python3Dir:$Python3BinDir:$PATH"
python3 -m pip install setuptools
python3 setup.py install
sudo ln -sf ${Python3BinDir}/sam /usr/local/bin/sam
# Cleanup downloaded files
rm -rf $TarballPath
rm -rf /tmp/awslabs-aws-sam-cli*
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"

View File

@@ -233,18 +233,6 @@
],
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"scripts": [
"{{template_dir}}/scripts/installers/aws-sam-cli.sh"
],
"environment_vars": [
"METADATA_FILE={{user `metadata_file`}}",
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
"DEBIAN_FRONTEND=noninteractive"
],
"execute_command": "/bin/sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "file",
"source": "{{template_dir}}/toolsets/toolcache-1604.json",
@@ -288,6 +276,18 @@
],
"execute_command": "sudo sh -c '{{ .Vars }} pwsh -f {{ .Path }}'"
},
{
"type": "shell",
"scripts": [
"{{template_dir}}/scripts/installers/aws-sam-cli.sh"
],
"environment_vars": [
"METADATA_FILE={{user `metadata_file`}}",
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
"DEBIAN_FRONTEND=noninteractive"
],
"execute_command": "/bin/sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"scripts":[

View File

@@ -237,18 +237,6 @@
],
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"scripts": [
"{{template_dir}}/scripts/installers/aws-sam-cli.sh"
],
"environment_vars": [
"METADATA_FILE={{user `metadata_file`}}",
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
"DEBIAN_FRONTEND=noninteractive"
],
"execute_command": "/bin/sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "file",
"source": "{{template_dir}}/toolsets/toolcache-1804.json",
@@ -292,6 +280,17 @@
],
"execute_command": "sudo sh -c '{{ .Vars }} pwsh -f {{ .Path }}'"
},
{
"type": "shell",
"scripts": [
"{{template_dir}}/scripts/installers/aws-sam-cli.sh"
],
"environment_vars": [
"METADATA_FILE={{user `metadata_file`}}",
"HELPER_SCRIPTS={{user `helper_script_folder`}}"
],
"execute_command": "/bin/sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"scripts":[

View File

@@ -238,18 +238,6 @@
],
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"scripts": [
"{{template_dir}}/scripts/installers/aws-sam-cli.sh"
],
"environment_vars": [
"METADATA_FILE={{user `metadata_file`}}",
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
"DEBIAN_FRONTEND=noninteractive"
],
"execute_command": "/bin/sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "file",
"source": "{{template_dir}}/toolsets/toolcache-2004.json",
@@ -293,6 +281,18 @@
],
"execute_command": "sudo sh -c '{{ .Vars }} pwsh -f {{ .Path }}'"
},
{
"type": "shell",
"scripts": [
"{{template_dir}}/scripts/installers/aws-sam-cli.sh"
],
"environment_vars": [
"METADATA_FILE={{user `metadata_file`}}",
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
"DEBIAN_FRONTEND=noninteractive"
],
"execute_command": "/bin/sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"scripts":[