forked from btungut/azure-devops-agent-on-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pre-install python version for self-hosted (btungut#17)
- Loading branch information
Showing
2 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
AGENT_TOOLSDIRECTORY="/azp/_work/_tool" | ||
|
||
# Adding ppa to fetch old python versions | ||
add-apt-repository ppa:deadsnakes/ppa | ||
|
||
echo "Available python version to install: $PYTHON_AVAILABLE_VERSION_VERSIONS" | ||
for py in $PYTHON_AVAILABLE_VERSION_VERSIONS | ||
do | ||
echo "--------------------------------------------------------" | ||
apt install -qq -y python$py-dev python$py-venv | ||
|
||
PYTHON_VERSION=$(python$py -V | cut -d " " -f2) | ||
mkdir -p $AGENT_TOOLSDIRECTORY/Python/$PYTHON_VERSION | ||
if [[ $? == 1 ]]; then echo "Failed created python $py version folder";exit 1;fi | ||
|
||
cd $AGENT_TOOLSDIRECTORY/Python/$PYTHON_VERSION | ||
python$py -m venv x64 | ||
touch x64.complete | ||
cd x64 | ||
mkdir -p share | ||
ln -s bin/python$py python | ||
cd .. | ||
cd .. | ||
|
||
ln -s $PYTHON_VERSION $py | ||
echo "Available versions:" | ||
tree -L 1 | ||
done |