Copy Python for build aws sam cli (#1267)

* Copy Python for build aws sam cli

* Minor fix

* Set sudo user

* Move sudo to templates
This commit is contained in:
Vladimir Safonkin
2020-07-22 09:41:09 +00:00
committed by GitHub
parent 5e23b76186
commit 16f3e4b83c
4 changed files with 11 additions and 9 deletions

View File

@@ -15,13 +15,15 @@ wget $TarballUrl -O $TarballPath
tar -xzvf $TarballPath -C /tmp tar -xzvf $TarballPath -C /tmp
cd /tmp/awslabs-aws-sam-cli* cd /tmp/awslabs-aws-sam-cli*
# Use python 3.7 from toolcache to install aws sam, setuptools package required for the installation mkdir /opt/python-aws-sam-cli
Python3Dir=$(echo /opt/hostedtoolcache/Python/3.7*/x64) 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="${Python3Dir}/bin"
export PATH="$Python3Dir:$Python3BinDir:$PATH" $Python3BinDir/python3 -m pip install setuptools
python3 -m pip install setuptools $Python3BinDir/python3 setup.py install
python3 setup.py install ln -sf ${Python3BinDir}/sam /usr/local/bin/sam
sudo ln -sf ${Python3BinDir}/sam /usr/local/bin/sam
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"

View File

@@ -259,7 +259,7 @@
"METADATA_FILE={{user `metadata_file`}}", "METADATA_FILE={{user `metadata_file`}}",
"HELPER_SCRIPTS={{user `helper_script_folder`}}" "HELPER_SCRIPTS={{user `helper_script_folder`}}"
], ],
"execute_command": "/bin/sh -c '{{ .Vars }} {{ .Path }}'" "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
}, },
{ {
"type": "shell", "type": "shell",

View File

@@ -263,7 +263,7 @@
"METADATA_FILE={{user `metadata_file`}}", "METADATA_FILE={{user `metadata_file`}}",
"HELPER_SCRIPTS={{user `helper_script_folder`}}" "HELPER_SCRIPTS={{user `helper_script_folder`}}"
], ],
"execute_command": "/bin/sh -c '{{ .Vars }} {{ .Path }}'" "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
}, },
{ {
"type": "shell", "type": "shell",

View File

@@ -264,7 +264,7 @@
"METADATA_FILE={{user `metadata_file`}}", "METADATA_FILE={{user `metadata_file`}}",
"HELPER_SCRIPTS={{user `helper_script_folder`}}" "HELPER_SCRIPTS={{user `helper_script_folder`}}"
], ],
"execute_command": "/bin/sh -c '{{ .Vars }} {{ .Path }}'" "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
}, },
{ {
"type": "shell", "type": "shell",