Skip to content

Commit

Permalink
#21 (comment): Resolved the issue on clear database, added a "clear" …
Browse files Browse the repository at this point in the history
…task to make to start a clear environment

Adjusted post-install tasks to https://github.com/taigaio/taiga-scripts/blob/master/scripts/setup-backend.sh#L49
  • Loading branch information
blackandred committed Dec 28, 2019
1 parent 9dff212 commit b35d22d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ help:
start: _prepare_env ## Start the environment (params: VERSION)
${SUDO} bash -c "VERSION=${VERSION} ${COMPOSE_CMD} up"

clear: ## Remove all volumes and containers
${SUDO} bash -c "VERSION=${VERSION} ${COMPOSE_CMD} down -v"
${SUDO} bash -c "VERSION=${VERSION} ${COMPOSE_CMD} rm -s -f -v"

start_detached: _prepare_env ## Start the environment in the background (params: VERSION)
${SUDO} bash -c "VERSION=${VERSION} ${COMPOSE_CMD} up -d"

Expand Down
5 changes: 4 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ migrate() {
# Setup database automatically if needed
while [ "$DB_AVAILABLE" = "false" ]; do
echo "Running database check"

set +e
python /checkdb.py
DB_CHECK_STATUS=$?
set -e

if [ $DB_CHECK_STATUS -eq 1 ]; then
DB_FAILED_TIME=$(date +%s)
Expand All @@ -52,8 +55,8 @@ migrate() {
python manage.py migrate --noinput
python manage.py loaddata initial_user
python manage.py loaddata initial_project_templates
python manage.py loaddata initial_role
python manage.py compilemessages
python manage.py rebuild_timeline --purge
else
DB_AVAILABLE="true"
fi
Expand Down

0 comments on commit b35d22d

Please sign in to comment.