Skip to content

Commit

Permalink
setup virtualenv for server. Fix PiPot/PiPot#7
Browse files Browse the repository at this point in the history
  • Loading branch information
VertexC committed Mar 2, 2019
1 parent 357360a commit 56ff73a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion install/install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,22 @@ echo ""
echo "* Updating package list "
apt-get update >> "$install_log" 2>&1
echo "* Installing nginx, python & pip "
apt-get -q -y install dnsutils nginx python python-dev python-pip >> "$install_log" 2>&1
apt-get -q -y install virtualenv dnsutils nginx python python-dev python-pip >> "$install_log" 2>&1
if [ ! -f /etc/init.d/mysql* ]; then
echo "* Installing MySQL (root password will be empty!)"
DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server >> "$install_log" 2>&1
fi
read -e -p "Name of the virtualenv: " -i "" virtualenv_name
virtualenv_name="/usr/src/pipot/$virtualenv_name"
# Check if virtulenv has been created
if [ ! -d $virtualenv_name ]; then
echo "* Create virtualenv $virtualenv_name"
virtualenv $virtualenv_name
else
echo "* Use virtualenv $virtualenv_name"
fi
source $virtualenv_name/bin/activate

echo "* Update setuptools "
easy_install -U setuptools >> "$install_log" 2>&1
echo "* Installing pip dependencies"
Expand Down Expand Up @@ -140,3 +151,4 @@ echo ""
echo "* Starting PiPot..."
service pipot start
echo "PiPot installed!"
deactivate

0 comments on commit 56ff73a

Please sign in to comment.