add configmap-plugins file
This commit is contained in:
parent
a2482e4830
commit
be949c2942
30
base/resources/nextcloud/resources/ConfigMap-plugins.yaml
Normal file
30
base/resources/nextcloud/resources/ConfigMap-plugins.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: script-config-plugins
|
||||||
|
data:
|
||||||
|
poststart-plugins.sh: |
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
NEXTCLOUD_READY=0
|
||||||
|
MAX_RETRIES=30
|
||||||
|
RETRY_INTERVAL=10
|
||||||
|
|
||||||
|
touch /etc/script/plugins.txt
|
||||||
|
|
||||||
|
for i in $(seq 1 $MAX_RETRIES); do
|
||||||
|
if curl -fsS "http://localhost/status.php" > /dev/null; then
|
||||||
|
NEXTCLOUD_READY=1
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "En attente de Nextcloud (tentative $i/$MAX_RETRIES)..." >> /etc/script/plugins.txt
|
||||||
|
sleep $RETRY_INTERVAL
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $NEXTCLOUD_READY -eq 0 ]; then
|
||||||
|
echo "Nextcloud n'est pas prêt après $MAX_RETRIES tentatives. Abandon de l'initialisation des plugins." >> /etc/script/plugins.txt
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
su -s /bin/sh -c "/var/www/html/occ app:install calendar" www-data
|
Loading…
Reference in New Issue
Block a user