Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions scripts/st2bootstrap-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,34 @@ setup_args() {
exit 1
fi
fi

# Python 3.6 package is not available in Ubuntu Xenial
# Installer can add it via 3rd party PPA based on user agreement
if [[ "$SUBTYPE" = 'xenial' ]]; then
sudo apt-get update > /dev/null 2>/dev/null
# check if python3.6 is available
if (! apt-cache show python3.6 2> /dev/null | grep 'Package:' > /dev/null); then
echo ""
echo "WARNING!"
echo "python3.6 package is required as a dependency for StackStorm and none of your software repositories provide it."
echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS."
echo ""
echo "Alternatively we'll try to add 3rd party python3.6 APT repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa."
echo "By continuing you're aware of security risk associated with using unofficial 3rd party PPA repository."
echo ""
read -p "Press [y] to continue or [n] to cancel adding it: " choice
Copy link
Copy Markdown
Member Author

@arm4b arm4b Dec 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to not provide a dedicated installation flag for Ubuntu Xenial installer as everything could be already done with yes | or echo 'y' | from the user side anyways as answer to this [y/n] question.

Copy link
Copy Markdown
Member Author

@arm4b arm4b Dec 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amanda11 ^^ I believe that should answer your question about running installer in non-interactive mode.

Even if we add --install-py3-from-insecure-ppa or whatever flag for extra security, - it makes little sense as users would be able to use yes | installer or echo y | installer to answer the question in a native Linux way.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - so we just need to update the E2E tests to install with an echo "y" | installer then?
Fine with me.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's fine with me as well.

case "$choice" in
y|Y )
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776
echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-xenial.list
;;
* )
echo "python3.6 PPA installation aborted"
exit 1
;;
esac
fi
fi
}


Expand Down
28 changes: 28 additions & 0 deletions scripts/st2bootstrap-deb.template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,34 @@ setup_args() {
exit 1
fi
fi

# Python 3.6 package is not available in Ubuntu Xenial
# Installer can add it via 3rd party PPA based on user agreement
if [[ "$SUBTYPE" = 'xenial' ]]; then
sudo apt-get update > /dev/null 2>/dev/null
# check if python3.6 is available
if (! apt-cache show python3.6 2> /dev/null | grep 'Package:' > /dev/null); then
echo ""
echo "WARNING!"
echo "python3.6 package is required as a dependency for StackStorm and none of your software repositories provide it."
echo "We recommend switching to Ubuntu 18.04 LTS (Bionic) as a base OS."
echo ""
echo "Alternatively we'll try to add 3rd party python3.6 APT repository: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa."
echo "By continuing you're aware of security risk associated with using unofficial 3rd party PPA repository."
echo ""
read -p "Press [y] to continue or [n] to cancel adding it: " choice
case "$choice" in
y|Y )
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776
echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ubuntu-ppa-xenial.list
;;
* )
echo "python3.6 PPA installation aborted"
exit 1
;;
esac
fi
fi
}


Expand Down