3
0
mirror of https://github.com/mastodon/chart synced 2025-03-14 21:11:50 +00:00

Fix ordering for db:prepare and db:migrate (#174)

This commit is contained in:
Tim Campbell 2025-03-06 12:33:17 +01:00 committed by GitHub
parent 36581ab5b7
commit ad5d09a5d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 27 additions and 5 deletions

View File

@ -1,3 +1,15 @@
# 6.0.1
- Added additional values to separate out `db:prepare` and `db:migrate` jobs and whether they should run:
```yaml
mastodon:
hooks:
dbPrepare:
enabled: true
dbMigrate:
enabled: true
```
# 6.0.0 # 6.0.0
### !! BREAKING CHANGES !! ### !! BREAKING CHANGES !!

View File

@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time # This is the chart version. This version number should be incremented each time
# you make changes to the chart and its templates, including the app version. # you make changes to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/) # Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 6.0.0 version: 6.0.1
# This is the version number of the application being deployed. This version number should be # This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to # incremented each time you make changes to the application. Versions are not expected to

View File

@ -24,7 +24,11 @@ metadata:
"helm.sh/hook": post-install,post-upgrade "helm.sh/hook": post-install,post-upgrade
{{- end }} {{- end }}
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
{{- if .prepare }}
"helm.sh/hook-weight": "-3"
{{- else }}
"helm.sh/hook-weight": "-2" "helm.sh/hook-weight": "-2"
{{- end }}
spec: spec:
template: template:
metadata: metadata:

View File

@ -1,3 +1,3 @@
{{- if and .Values.mastodon.hooks.dbMigrate.enabled (not .Values.postgresql.enabled) }} {{- if and .Values.mastodon.hooks.dbPrepare.enabled (not .Values.postgresql.enabled) }}
{{- include "mastodon.dbMigrateJob" (merge (dict "prepare" true ) .) }} {{- include "mastodon.dbMigrateJob" (merge (dict "prepare" true ) .) }}
{{- end }} {{- end }}

View File

@ -24,9 +24,15 @@ mastodon:
# @ignored # @ignored
email: not@example.com email: not@example.com
hooks: hooks:
# Whether to perform DB preparations & migrations on `helm install|upgrade`. # Whether to perform DB schema creation on `helm install`.
# Please note that initial DB schema creation on `helm install` does not # Please note that this does not work when using the included database
# work when using the included database (postgresql.enabled=true). # (postgresql.enabled=true).
# NOTE: When using certain GitOps solutions such as Argo CD, this should be
# disabled, as these apps do not necessarily differentiate between `pre-install`
# and `pre-upgrade`.
dbPrepare:
enabled: true
# Whether to perform DB migrations on `helm upgrade`.
dbMigrate: dbMigrate:
enabled: true enabled: true
# Upload website assets to S3 before deploying using rclone. # Upload website assets to S3 before deploying using rclone.