-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚧 (dashboard) add superuser creation commands
- Renamed `create-superuser` to `create-api-superuser` for clarity. Added `create-dashboard-superuser` target to handle Dashboard superuser creation. Add DJANGO_SUPERUSER_PASSWORD to env.d/dashboard - Fix migrate-dashboard-db in Makefile - Fix typo in readme.md
- Loading branch information
Showing
3 changed files
with
18 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ bootstrap: \ | |
create-dashboard-db \ | ||
seed-metabase \ | ||
seed-oidc \ | ||
create-superuser \ | ||
create-api-superuser \ | ||
jupytext--to-ipynb \ | ||
seed-api | ||
.PHONY: bootstrap | ||
|
@@ -226,14 +226,13 @@ migrate-api: ## run alembic database migrations for the api service | |
.PHONY: migrate-api | ||
|
||
migrate-dashboard-db: ## create dashboard database | ||
@echo "Creating dashboard service database…" | ||
@echo "Running dashboard service database engine…" | ||
@$(COMPOSE_UP) --wait postgresql | ||
@echo "Creating dashboard service database…" | ||
@$(COMPOSE) exec postgresql bash -c 'psql "postgresql://$${POSTGRES_USER}:$${POSTGRES_PASSWORD}@$${QUALICHARGE_DB_HOST}:$${QUALICHARGE_DB_PORT}/postgres" -c "create database \"$${DASHBOARD_DB_NAME}\";"' || echo "Duly noted, skipping database creation." | ||
@echo "Migrating dashboard database…"# | ||
@bin/manage migrate | ||
.PHONY: migrate-dashboard-db | ||
|
||
create-superuser: ## create super user | ||
create-api-superuser: ## create super user | ||
@echo "Creating super user…" | ||
@$(COMPOSE_RUN_API_PIPENV) python -m qualicharge create-user \ | ||
admin \ | ||
|
@@ -243,7 +242,17 @@ create-superuser: ## create super user | |
--is-superuser \ | ||
--is-staff \ | ||
--force | ||
.PHONY: create-superuser | ||
.PHONY: create-api-superuser | ||
|
||
create-dashboard-superuser: ## create dashboard super user | ||
@echo "Running dashboard service database engine…" | ||
@$(COMPOSE_UP) --wait postgresql | ||
@echo "Creating dashboard super user…" | ||
@bin/manage createsuperuser \ | ||
--noinput \ | ||
--username admin \ | ||
--email [email protected] | ||
.PHONY: create-dashboard-superuser | ||
|
||
jupytext--to-md: ## convert local ipynb files into md | ||
bin/jupytext --to md work/src/notebook/**/*.ipynb | ||
|
@@ -257,7 +266,7 @@ reset-db: ## Reset the PostgreSQL database | |
$(COMPOSE) stop | ||
$(COMPOSE) down postgresql metabase | ||
$(MAKE) migrate-api | ||
$(MAKE) create-superuser | ||
$(MAKE) create-api-superuser | ||
$(MAKE) create-api-test-db | ||
$(MAKE) create-metabase-db | ||
$(MAKE) seed-metabase | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters