Skip to content

Commit

Permalink
Restore contrib/docker/docker-init.sh to its initial state
Browse files Browse the repository at this point in the history
Signed-off-by: David Pordomingo <[email protected]>
  • Loading branch information
dpordomingo committed Jul 31, 2019
1 parent d88f81f commit ab8d628
Showing 1 changed file with 9 additions and 40 deletions.
49 changes: 9 additions & 40 deletions superset/contrib/docker/docker-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,16 @@
#
set -ex

# always run migrations
superset db upgrade

# always gitbase script to update datasource if it was changed in env var
python add_gitbase.py

# add metadata data source only in sync mode
if [ ! -z "$SYNC_MODE" ]; then
python add_metadata_db.py
fi
# Create an admin user (you will be prompted to set username, first and last name before setting a password)
fabmanager create-admin --app superset

# initialize database if empty
if ! fabmanager list-users --app superset | grep -q $ADMIN_LOGIN; then
# Create an admin user
fabmanager create-admin \
--app superset \
--username $ADMIN_LOGIN \
--firstname $ADMIN_FIRST_NAME \
--lastname $ADMIN_LAST_NAME \
--email $ADMIN_EMAIL \
--password $ADMIN_PASSWORD

# Create default roles and permissions
superset init

# Add dashboards
superset import_dashboards --path /home/superset/dashboards/gitbase/overview.json

# Add local or organization dashboards
if [ -z "$SYNC_MODE" ]; then
sleep 2s
superset import_dashboards --path /home/superset/dashboards/gitbase/welcome.json
else
sleep 2s
superset import_dashboards --path /home/superset/dashboards/metadata/welcome.json

sleep 2s
superset import_dashboards --path /home/superset/dashboards/metadata/collaboration.json
fi
# Initialize the database
superset db upgrade

# set welcome dashboard as a default
python set_default_dashboard.py
if [ "$SUPERSET_LOAD_EXAMPLES" = "yes" ]; then
# Load some data to play with
superset load_examples
fi

# Create default roles and permissions
superset init

0 comments on commit ab8d628

Please sign in to comment.