init_metabase
This commit is contained in:
@@ -89,7 +89,6 @@ services:
|
|||||||
|
|
||||||
mongodb:
|
mongodb:
|
||||||
image: mongodb/mongodb-community-server:8.0-ubi8
|
image: mongodb/mongodb-community-server:8.0-ubi8
|
||||||
restart: no
|
|
||||||
volumes:
|
volumes:
|
||||||
- mongodb_configdb:/data/configdb
|
- mongodb_configdb:/data/configdb
|
||||||
- mongodb_data:/data/db
|
- mongodb_data:/data/db
|
||||||
@@ -104,7 +103,6 @@ services:
|
|||||||
# https://redis.io/fr/
|
# https://redis.io/fr/
|
||||||
redis:
|
redis:
|
||||||
image: redis:8.2
|
image: redis:8.2
|
||||||
restart: no
|
|
||||||
command:
|
command:
|
||||||
- 'redis-server'
|
- 'redis-server'
|
||||||
- '--save 60 1'
|
- '--save 60 1'
|
||||||
@@ -126,7 +124,6 @@ services:
|
|||||||
# https://neo4j.com/
|
# https://neo4j.com/
|
||||||
neo4j:
|
neo4j:
|
||||||
image: neo4j:5.26.12-community
|
image: neo4j:5.26.12-community
|
||||||
restart: no
|
|
||||||
ports:
|
ports:
|
||||||
- 7473:7473
|
- 7473:7473
|
||||||
- 7474:7474
|
- 7474:7474
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ import requests
|
|||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
METABASE_URL = os.getenv("METABASE_URL", "http://127.0.0.1:3000")
|
METABASE_URL = os.getenv("METABASE_URL", "http://metabase:3000")
|
||||||
payload = {
|
|
||||||
|
|
||||||
# Admin Metabase
|
# Admin Metabase
|
||||||
ADMIN_FIRST_NAME = os.getenv("MB_FIRST_NAME", "Admin")
|
ADMIN_FIRST_NAME = os.getenv("MB_FIRST_NAME", "Admin")
|
||||||
@@ -198,7 +197,7 @@ if __name__ == "__main__":
|
|||||||
session = run_setup(token)
|
session = run_setup(token)
|
||||||
|
|
||||||
db_id = add_database(session, DB)
|
db_id = add_database(session, DB)
|
||||||
coll_id = get_or_create_collection(session, "IUT Dashboard")
|
coll_id = get_or_create_collection(session, "Collection Cocagne")
|
||||||
|
|
||||||
# Exemple : une question SQL
|
# Exemple : une question SQL
|
||||||
q1 = get_or_create_question(
|
q1 = get_or_create_question(
|
||||||
@@ -210,7 +209,7 @@ if __name__ == "__main__":
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Exemple : un dashboard
|
# Exemple : un dashboard
|
||||||
dash_id = get_or_create_dashboard(session, "Vue d'ensemble", coll_id)
|
dash_id = get_or_create_dashboard(session, "Statistiques Adhérents", coll_id)
|
||||||
add_question_to_dashboard(session, dash_id, q1)
|
# add_question_to_dashboard(session, dash_id, q1)
|
||||||
|
|
||||||
print("🎉 Initialisation Metabase terminée avec dashboards/questions")
|
print("🎉 Initialisation Metabase terminée")
|
||||||
|
|||||||
Reference in New Issue
Block a user