From e52a399e18cf057fc507dcca8688a62efc726fc8 Mon Sep 17 00:00:00 2001 From: Brylie Christopher Oxley Date: Mon, 28 Sep 2020 20:51:50 +0300 Subject: [PATCH] Reorganize steps (#11015) Reorganize steps to 1. run db migrations 2. create default roles/permissions 3. create admin user 4. (optional) load examples --- docker/docker-init.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docker/docker-init.sh b/docker/docker-init.sh index 3a42b8ca9..a2e86b983 100755 --- a/docker/docker-init.sh +++ b/docker/docker-init.sh @@ -33,29 +33,29 @@ Init Step ${1}/${STEP_CNT} [${2}] -- ${3} EOF } +# Initialize the database +echo_step "1" "Starting" "Applying DB migrations" +superset db upgrade +echo_step "1" "Complete" "Applying DB migrations" + # Create an admin user -echo_step "1" "Starting" "Setting up admin user ( admin / admin )" +echo_step "2" "Starting" "Setting up admin user ( admin / admin )" superset fab create-admin \ --username admin \ --firstname Superset \ --lastname Admin \ --email admin@superset.com \ --password admin -echo_step "1" "Complete" "Setting up admin user" +echo_step "2" "Complete" "Setting up admin user" -# Initialize the database -echo_step "2" "Starting" "Applying DB migrations" -superset db upgrade -echo_step "2" "Complete" "Applying DB migrations" +# Create default roles and permissions +echo_step "3" "Starting" "Setting up roles and perms" +superset init +echo_step "3" "Complete" "Setting up roles and perms" if [ "$SUPERSET_LOAD_EXAMPLES" = "yes" ]; then # Load some data to play with - echo_step "3" "Starting" "Loading examples" + echo_step "4" "Starting" "Loading examples" superset load_examples - echo_step "3" "Complete" "Loading examples" + echo_step "4" "Complete" "Loading examples" fi - -# Create default roles and permissions -echo_step "4" "Starting" "Setting up roles and perms" -superset init -echo_step "4" "Complete" "Setting up roles and perms"