discourse/bin/docker/reset_db

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
528 B
Plaintext
Raw Normal View History

2015-11-01 21:33:08 -05:00
#!/bin/bash
SCRIPTPATH=$(cd "$(dirname "$0")" >/dev/null; pwd -P)
SOURCE_DIR=$(cd "$SCRIPTPATH" && cd ../.. && pwd -P)
DATA_DIR=$SOURCE_DIR/data/postgres
2015-11-01 21:33:08 -05:00
# Should this also run /etc/runit/1.d/ensure_database, or will that
# happen automatically? -- It will happen, but restarting the container is required
2019-09-04 02:19:48 -04:00
docker run -it -v $DATA_DIR:/shared/postgres_data discourse/discourse_dev:release /bin/bash -c "rm -fr /shared/postgres_data/*"
docker restart discourse_dev
echo "Creating admin user..."
"${SCRIPTPATH}/rake" admin:create