Add deployment stuffs

This commit is contained in:
Jan Tuomi
2017-09-15 15:40:17 +03:00
parent 2c9c1a76c8
commit b0235d6089
5 changed files with 226 additions and 10 deletions
+13 -5
View File
@@ -5,7 +5,13 @@ echo "This script will set up the environment for this project."
echo "========================================================="
echo "Dependencies: postgresql>9.5, python>3.5"
read -p "Are these programs installed? [y/n]" -n 1 -r
INTERACTIVE="true"
if [[ $* == *--no-input* ]]
then
INTERACTIVE="false"
fi
$INTERACTIVE && read -p "Are these programs installed? [y/n]" -n 1 -r || REPLY="y"
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]
@@ -14,7 +20,7 @@ then
exit 0
fi
read -p "Create user 'sik' in postgres (needs sudo) [y/n]?" -n 1 -r
$INTERACTIVE && read -p "Create user 'sik' in postgres (needs sudo) [y/n]?" -n 1 -r || REPLY="n"
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]
@@ -22,7 +28,7 @@ then
sudo -u postgres psql < "$PWD/scripts/db/init.sql"
fi
read -p "Is virtualenv activated? [y/n]" -n 1 -r
$INTERACTIVE && read -p "Is virtualenv activated? [y/n]" -n 1 -r || REPLY="y"
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]
@@ -31,7 +37,7 @@ then
exit 0
fi
read -p "Copy settings from template? [y/n]" -n 1 -r
$INTERACTIVE && read -p "Copy settings from template? [y/n]" -n 1 -r || REPLY="y"
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]
@@ -40,7 +46,7 @@ then
fi
read -p "Start setup? [y/n]" -n 1 -r
$INTERACTIVE && read -p "Start setup? [y/n]" -n 1 -r || REPLY="y"
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]
@@ -49,10 +55,12 @@ then
exit 0
fi
set -e
(set -x; pip install -r requirements.txt)
(set -x; npm install)
(set -x; python manage.py migrate)
(set -x; python manage.py createdefaultadmin)
set +e
echo "Done."
echo "Run 'python manage.py runserver 0.0.0.0:8000' to start the development server!"