👷(helm) command createsuperuser

We sometimes need a superuser in the Django
application, to fix eventual db issues.
This commit adds a superuser on the pods.
This commit is contained in:
Anthony LC
2024-05-13 09:39:33 +02:00
committed by Anthony LC
parent f0b3090a73
commit f0a4de361e
5 changed files with 168 additions and 44 deletions

View File

@@ -66,16 +66,3 @@ cmd_button('Migrate db',
icon_name='developer_board',
text='Run database migration',
)
pod_add_admin = '''
set -eu
# get k8s pod name from tilt resource name
POD_NAME="$(tilt get kubernetesdiscovery impress-backend -ojsonpath='{.status.pods[0].name}')"
kubectl -n impress exec "$POD_NAME" -- python manage.py createsuperuser --email admin@example.com --password admin
'''
cmd_button('Add admin',
argv=['sh', '-c', pod_add_admin],
resource='impress-backend',
icon_name='developer_board',
text='Create superadmin',
)