Skip to content

Commit

Permalink
update to minikube config
Browse files Browse the repository at this point in the history
  • Loading branch information
ddonahue007 committed Mar 14, 2023
1 parent 7837264 commit 7f2b5c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 3 additions & 3 deletions scripts/create_superuser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ SCRIPTS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
PROJECT_DIR="${SCRIPTS_DIR}/.."

export DEBUG=${DEBUG:-false}
export IN_DOCKER=${IN_DOCKER:-false}
export EDA_DB_HOST=${EDA_DB_HOST:-localhost}
export EDA_DB_PASSWORD=${EDA_DB_PASSWORD:-secret}

# import common & logging
source "${SCRIPTS_DIR}"/common/logging.sh
Expand All @@ -28,8 +29,7 @@ usage() {
}

create_user() {
local _container_name="$(docker container ls -f name=^eda-postgres --format {{.Names}} 2> /dev/null)"

log-debug "EDA_DB_HOST: ${EDA_DB_HOST}"
log-debug "poetry run /usr/bin/env src/aap_eda/manage.py createsuperuser --noinput"
if poetry run /usr/bin/env src/aap_eda/manage.py createsuperuser --noinput &> /dev/null; then
log-info "Superuser created"
Expand Down
8 changes: 2 additions & 6 deletions tools/deploy/eda-api/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
- args:
- /bin/bash
- -c
- aap-eda-manage migrate && aap-eda-manage runserver 0.0.0.0:8000
- aap-eda-manage migrate && scripts/create_superuser.sh && aap-eda-manage runserver 0.0.0.0:8000
env:
- name: EDA_DATABASE_URL
value: postgresql+asyncpg://postgres:secret@postgres/eda
Expand Down Expand Up @@ -56,9 +56,5 @@ spec:
- name: DJANGO_SUPERUSER_EMAIL
value: ${DJANGO_SUPERUSER_EMAIL:[email protected]}
image: docker.io/alpine:latest
command: [ 'sh', '-c', "until nslookup eda-${EDA_DB_HOST}.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for ${EDA_DB_HOST}; sleep 2; done" ]
- name: add-superuser
image: aap-eda
imagePullPolicy: Never
command: [ 'sh', '-c', "aap-eda-manage createsuperuser --noinput" ]
command: [ 'sh', '-c', "until nslookup ${EDA_DB_HOST}.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for ${EDA_DB_HOST}; sleep 2; done" ]
status: {}

0 comments on commit 7f2b5c4

Please sign in to comment.