Skip to content
Snippets Groups Projects
Unverified Commit 668a0187 authored by Varac's avatar Varac
Browse files

Add maintenance tasks to setup-app script

Fixes: #1015
Part of: #1016
parent 6b4ee313
No related branches found
No related tags found
1 merge request!139Fix NC app updates, run maintenance tasks
......@@ -28,12 +28,36 @@ data:
}
setup-apps.sh: |
#!/bin/bash
#
# This is a post-install,post-upgrade helm hook, which
#
# * Persists and loads the onlyoffice-config.json config file
# * Run upgrade routines after installation of a new release.
# * Updates all applications
# * Installs all apps declared in the `apps` helm values array
# * Configures single-sign-on
# * Update database indices, columns, keys, etc needed after NC upgrade
set -ev
# Debug: place the json file in a persistent location for reuse
cp /var/local/onlyoffice-config.json /var/www/html/
occ="/var/www/html/occ"
# Run upgrade routines after installation of a new release.
php $occ upgrade --no-interaction
# Enable app store so we can run `install` and `enable` commands
php $occ config:system:set appstoreenabled --type boolean --value true
# Update all apps to their latest version, so they are compatible
# with the new NC version.
# Unfortunatly the occ app:install cmd doesn't allow to pin apps to
# a certain version.
php $occ app:update --all --no-interaction
# Install all apps declared in the `apps` helm values array
{{- range .Values.apps }}
# -- Begin {{ .name }}
# Only install {{ .name }} if it's not installed already
......@@ -51,8 +75,16 @@ data:
php $occ config:app:set sociallogin custom_providers --value='{"custom_oidc": [{{ .Values.sociallogin.custom_oidc | toJson }}]}'
php $occ config:app:set sociallogin auto_create_groups --value='{{ .Values.sociallogin.auto_create_groups }}'
php $occ config:app:set sociallogin update_profile_on_login --value='{{ .Values.sociallogin.update_profile_on_login }}'
# Disable app store again
php $occ config:system:set appstoreenabled --type boolean --value false
# Update database indices, columns, keys, etc needed after NC upgrade
php $occ db:add-missing-indices --no-interaction
php $occ db:add-missing-columns --no-interaction
php $occ db:add-missing-primary-keys --no-interaction
php $occ db:convert-filecache-bigint --no-interaction
#
# All values in config.json are applied by the nextcloud occ command
# config:import.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment