Skip to content

Commit

Permalink
Confirm created users and add create fixtures option to init job
Browse files Browse the repository at this point in the history
  • Loading branch information
J4bbi committed Aug 21, 2024
1 parent 0c3d0b3 commit 1cebcb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions charts/invenio/templates/install-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ metadata:
"helm.sh/hook": post-install
"helm.sh/hook-weight": "1"
{{/* "helm.sh/hook-delete-policy": hook-succeeded*/}}
{{- $cmd := "invenio db init && invenio db create && invenio index init && invenio index queue init purge && invenio files location --default 'default-location' $(invenio shell --no-term-title -c \"print(app.instance_path)\")'/data' && invenio roles create admin && invenio access allow superuser-access role admin" -}}
{{- $cmd := "invenio db init && invenio db create && invenio index init && invenio index queue init purge && invenio files location --default 'default-location' $(invenio shell --no-term-title -c \"print(app.instance_path)\")'/data' && invenio roles create admin && invenio access allow superuser-access role admin" -}}
{{- range $usr, $pass := .Values.invenio.default_users -}}
{{- $cmd = printf "%s && invenio users create --active --password=%s %s" $cmd $pass $usr -}}
{{- $cmd = printf "%s && invenio users create --active --confirm --password=%s %s" $cmd $pass $usr -}}
{{- end -}}
{{- if and .Values.invenio.demo_data .Values.invenio.default_users -}}
{{- $cmd = cat $cmd "&& invenio rdm-records demo" -}}
{{- end -}}
{{- if .Values.invenio.create_fixtures -}}
{{- $cmd = cat $cmd "&& invenio rdm-records fixtures" -}}
{{- end -}}


spec:
template:
Expand Down
1 change: 1 addition & 0 deletions charts/invenio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ invenio:
init: false
default_users: [] # Requires invenio.init=true
demo_data: false # Setting invenio.demo_data=true requires also setting default_users!
create_fixtures: false # This can take several minutes!!
sentry:
enabled: false
existing_secret: false
Expand Down

0 comments on commit 1cebcb2

Please sign in to comment.