👷(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:
13
bin/Tiltfile
13
bin/Tiltfile
@@ -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',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user