summaryrefslogtreecommitdiff
path: root/install/ishtar-prepare-instance
diff options
context:
space:
mode:
Diffstat (limited to 'install/ishtar-prepare-instance')
-rwxr-xr-xinstall/ishtar-prepare-instance46
1 files changed, 23 insertions, 23 deletions
diff --git a/install/ishtar-prepare-instance b/install/ishtar-prepare-instance
index f9a3153e6..c86c93497 100755
--- a/install/ishtar-prepare-instance
+++ b/install/ishtar-prepare-instance
@@ -29,13 +29,11 @@ do_install_instance() {
PG_VERSION=9.4
POSTGIS_VERSION=2.3.1
- cat >&2 <<-'EOF'
-
-*******************************************************************************
-++++++ Ishtar instance installation script ++++++
-*******************************************************************************
-
-EOF
+ echo ""
+ cecho g "*******************************************************************************"
+ cecho g "++++++ Ishtar instance preparation script ++++++"
+ cecho g "*******************************************************************************"
+ echo ""
# check user
user="$(id -un 2>/dev/null || true)"
@@ -85,7 +83,7 @@ EOF
if [ -z '$INSTANCE' ]; then
if [ -d "$INSTANCE" ]; then
- cecho "Sorry, $INSTANCE already exists."
+ cecho r "Sorry, $INSTANCE already exists."
echo "Give another code name."
exit 1
fi
@@ -103,7 +101,8 @@ EOF
EOF
while [ "$INSTANCE" == '' ]
do
- read -p "* Which instance code name? [my_ishtar_instance] " choice
+ cecho y "* Which instance code name? [my_ishtar_instance] "
+ read choice
if [ -z "$choice" ]; then
INSTANCE='my_ishtar_instance'
else
@@ -129,7 +128,8 @@ EOF
EOF
while [ "$URL" == '' ]
do
- read -p "* Which url? " choice
+ cecho y "* Which url? "
+ read choice
URL=$choice
done
fi
@@ -152,7 +152,7 @@ EOF
chmod g+w "/var/log/django/ishtar-$INSTANCE.log"
- echo " * duplicate example_project into our instance"
+ cecho y " * duplicate example_project into our instance"
# Duplicate example_project into our instance:
cd $ISHTAR_PATH
cp -ra example_project $INSTANCE
@@ -206,7 +206,7 @@ EOF
### LOCAL SETTINGS
- echo " * creating config files"
+ cecho y " * creating config files"
# Set some variables to avoid changing sed calls too much compared to
# the initial install/install.sh script:
INSTALL_PATH=$DEST
@@ -273,14 +273,14 @@ EOF
"$NGINX_ENABLE_PATH/ishtar-$INSTANCE.conf"
- echo " * collect static data"
+ cecho y " * collect static data"
cd $INSTANCE
./manage.py collectstatic --noinput > /dev/null
cd -
# only language available
LOCALE=fr
- echo " * compile translations"
+ cecho y " * compile translations"
for d in archaeological_* ishtar_common; do
cd $d
../$INSTANCE/manage.py compilemessages -l $LOCALE
@@ -289,23 +289,23 @@ EOF
### DB feeding
cd $INSTANCE
- echo " * db feeding"
- echo " - migrations"
+ cecho y " * db feeding"
+ cecho y " - migrations"
./manage.py migrate
- echo " - loading fixtures"
+ cecho y " - loading fixtures"
FIXTURES="$DEST/fixtures/initial_data-auth-fr.json $DEST/ishtar_common/fixtures/initial_data-fr.json $DEST/ishtar_common/fixtures/initial_importtypes-fr.json $DEST/archaeological_operations/fixtures/initial_data-fr.json $DEST/archaeological_context_records/fixtures/initial_data-fr.json $DEST/archaeological_files/fixtures/initial_data-fr.json $DEST/archaeological_finds/fixtures/initial_data-fr.json $DEST/archaeological_warehouse/fixtures/initial_data-fr.json"
for data in $FIXTURES; do
echo $data;
./manage.py loaddata $data;
done
- echo " - create superuser"
+ cecho y " - create superuser"
./manage.py createsuperuser
- echo " - post install script"
+ cecho y " - post install script"
cd ..
- python install/post_install_script.py
+ python ./install/post_install_script.py $INSTANCE $URL
cat >&2 <<-'EOF'
@@ -318,10 +318,10 @@ EOF
cat >&2 <<-'EOF'
You should restart uwsgi and nginx:
- systemctl restart uwsgi nginx
-
- And then enjoy ishtar!
EOF
+ cecho y "systemctl restart uwsgi nginx"
+ echo ""
+ echo "And then enjoy ishtar!"
}
do_install_instance