Skip to content

Commit

Permalink
CST-10 znick#336 Moved db generator to deploy_local_beta
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhailyumanov committed Mar 13, 2021
1 parent 41da9ec commit 5e29c63
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
7 changes: 0 additions & 7 deletions anytask/generate_test_db.sh

This file was deleted.

13 changes: 5 additions & 8 deletions deploy_local_beta/deploy_local_beta_python2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,18 @@ pip install -r requirements_local.txt
ANYBETA_report
ANYBETA_report "Manage django project"
python setup.py develop
python ./anytask/manage.py migrate --noinput


# CREATE DB
###########

ANYBETA_report
ANYBETA_report "Create test database"
if test -e ./anytask/sqlite3.db
then
rm ./anytask/sqlite3.db
fi
./anytask/generate_test_db.sh
./anytask/manage.py create_test_data.sh

$ANYBETA_DEPLOY/generate_test_db.sh
$ANYBETA_ROOT/anytask/manage.py create_test_data

ANYBETA_report
ANYBETA_report "Deploy completed!"
ANYBETA_report "You can now start django server using ${ANYBETA_ROOT}/anytask/manage.py runserver"

fi
11 changes: 11 additions & 0 deletions deploy_local_beta/generate_test_db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

if test -e $ANYBETA_ROOT/sqlite3.db
then
rm $ANYBETA_ROOT/sqlite3.db
fi
$ANYBETA_ROOT/anytask/manage.py migrate --no-input
$ANYBETA_ROOT/anytask/manage.py createsuperuser --username=anytask --email=anytask@yandex.ru --noinput
echo 'from django.contrib.auth.models import User ; user=User.objects.get(username="anytask") ; user.set_password("pass") ; user.save() ; print "Password changed"' | $ANYBETA_ROOT/anytask/manage.py shell --plain

ANYBETA_report "anytask pass"

0 comments on commit 5e29c63

Please sign in to comment.