Skip to content
Snippets Groups Projects
Commit 78593fb2 authored by Gunnar Schaefer's avatar Gunnar Schaefer
Browse files

Don't bootstrap users unconditionally

parent acbd780f
No related branches found
No related tags found
No related merge requests found
...@@ -16,10 +16,6 @@ if [ "$#" -gt 2 ]; then ...@@ -16,10 +16,6 @@ if [ "$#" -gt 2 ]; then
exit 1 exit 1
fi fi
if ! [ -f "bootstrap.json" ]; then
echo "Please create bootstrap.json from bootstrap.json.sample"
exit 1
fi
if [ -f "`which brew`" ]; then if [ -f "`which brew`" ]; then
echo "Homebrew is installed" echo "Homebrew is installed"
...@@ -69,11 +65,17 @@ else ...@@ -69,11 +65,17 @@ else
echo "MongoDB installed" echo "MongoDB installed"
fi fi
if [ -d "$PERSITENT_DIR/db" ]; then if [ -f "$PERSITENT_DIR/db/mongod.lock" ]; then
echo "Persistence store exists at $PERSITENT_DIR/db" echo "Database exists at $PERSITENT_DIR/db. Not bootstrapping users."
BOOTSTRAP_USERS=0
else else
echo "Creating persistence store exists at $PERSITENT_DIR/db" echo "Creating database location at $PERSITENT_DIR/db"
mkdir -p $PERSITENT_DIR/db mkdir -p $PERSITENT_DIR/db
if ! [ -f "bootstrap.json" ]; then
echo "Cannot bootstrap users. Please create bootstrap.json from bootstrap.json.sample."
exit 1
fi
BOOTSTRAP_USERS=1
fi fi
...@@ -95,10 +97,12 @@ export PYTHONPATH=. ...@@ -95,10 +97,12 @@ export PYTHONPATH=.
bin/bootstrap.py configure mongodb://localhost/scitran local Local https://localhost:8080/api oauth_client_id bin/bootstrap.py configure mongodb://localhost/scitran local Local https://localhost:8080/api oauth_client_id
# Boostrap users # Boostrap users
bin/bootstrap.py users mongodb://localhost/scitran bootstrap.json if [ "$BOOTSTRAP_USERS" -eq "1" ]; then
bin/bootstrap.py users mongodb://localhost/scitran bootstrap.json
fi
if [ -d "$PERSITENT_DIR/data" ]; then if [ -d "$PERSITENT_DIR/data" ]; then
echo "The $PERSITENT_DIR/data directory is present, skipping data bootstrapping. Remove to re-bootstrap." echo "Persistence store exists at $PERSITENT_DIR/data. Not bootstrapping data. Remove to re-bootstrap."
else else
echo "Downloading testdata" echo "Downloading testdata"
curl https://codeload.github.com/scitran/testdata/tar.gz/master | tar xz -C $PERSITENT_DIR curl https://codeload.github.com/scitran/testdata/tar.gz/master | tar xz -C $PERSITENT_DIR
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment