-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make: DB init and create admin user after install
- Loading branch information
Diego Rodriguez
committed
May 20, 2020
1 parent
67c6d81
commit 82a4b74
Showing
3 changed files
with
27 additions
and
9 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
instance_name=$1 | ||
|
||
# Get REANA Server pod name | ||
REANA_SERVER=$(kubectl get pod -l "app=$instance_name-server" -o name \ | ||
-o jsonpath='{.items[0].metadata.name}') | ||
|
||
# Initialise DB | ||
kubectl exec "$REANA_SERVER" -- ./scripts/setup | ||
|
||
# Create admin user | ||
admin_access_token=$(kubectl exec "$REANA_SERVER" -- \ | ||
flask reana-admin create-admin-user admin@reana.org) | ||
|
||
# Add token to secrets | ||
kubectl create secret generic "$instance_name"-admin-access-token \ | ||
--from-literal=ADMIN_ACCESS_TOKEN="$admin_access_token" |