From a19aa35efd9f297f074ba9754a50bf06ec5736d7 Mon Sep 17 00:00:00 2001
From: Maarten de Waard <maarten@greenhost.nl>
Date: Tue, 10 Aug 2021 14:39:05 +0200
Subject: [PATCH] enable and disable app store around app installation commands

---
 CHANGELOG.md                    | 4 ++++
 Chart.yaml                      | 2 +-
 templates/nextcloud-config.yaml | 4 ++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f6978cc5..a2abdb37 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## [0.3.1] - 2021-08-10
+
+* Fix `setup-apps` job for chart upgrades with new apps
+
 ## [0.3.0] - 2021-08-04
 
 * Update NC chart to 2.7.0, including NC 20.0.11
diff --git a/Chart.yaml b/Chart.yaml
index ef9e2080..972e6d81 100644
--- a/Chart.yaml
+++ b/Chart.yaml
@@ -3,7 +3,7 @@ apiVersion: v2
 description: |
   A helm chart for installing NextCloud and setting up ONLYOFFICE integration
 name: nextcloud-onlyoffice
-version: 0.3.0
+version: 0.3.1
 appVersion: NC-20.0.11-OO-6.2.2.21
 dependencies:
   - name: nextcloud
diff --git a/templates/nextcloud-config.yaml b/templates/nextcloud-config.yaml
index 88ee2133..7036506e 100644
--- a/templates/nextcloud-config.yaml
+++ b/templates/nextcloud-config.yaml
@@ -43,6 +43,8 @@ data:
     cp /var/local/onlyoffice-config.json /var/www/html/
     cp /var/local/social-login-config.json /var/www/html/
     occ="/var/www/html/occ"
+    # Enable app store so we can run `install` and `enable` commands
+    php occ config:system:set appstoreenabled --type boolean --value true
     {{- range .Values.apps }}
     # -- Begin {{ .name }}
     # Only install {{ .name }} if it's not installed already
@@ -58,6 +60,8 @@ data:
     # Config settings from the configmap above
     php $occ config:import /var/local/onlyoffice-config.json
     php $occ config:import /var/local/social-login-config.json
+    # Disable app store again
+    php occ config:system:set appstoreenabled --type boolean --value false
   #
   # All values in config.json are applied by the nextcloud occ command
   #   config:import.
-- 
GitLab