Skip to content

Commit

Permalink
Update update-helm.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
szaimen committed Nov 21, 2024
1 parent 1dc8ebd commit 0ada346
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions nextcloud-aio-helm-chart/update-helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ if [ -f ./templates/manual-install-nextcloud-aio-networkpolicy.yaml ]; then
fi
# shellcheck disable=SC1083
find ./ -name '*networkpolicy.yaml' -exec sed -i "s|manual-install-nextcloud-aio|nextcloud-aio|" \{} \;
cat << EOL > /tmp/initcontainers
initContainers:
- name: init-volumes
image: "alpine:3.20"
command:
- chmod
- "777"
volumeMountsInitContainer:
EOL
cat << EOL > /tmp/initcontainers.database
initContainers:
- name: init-subpath
Expand Down Expand Up @@ -119,6 +128,8 @@ for variable in "${DEPLOYMENTS[@]}"; do
for volumeName in "${volumeNames[@]}"; do
# The Nextcloud container runs as root user and sets the correct permissions automatically for the data-dir if the www-data user cannot write to it
if [ "$volumeName" != "nextcloud-aio-nextcloud-data" ]; then
sed -i "/^.*volumeMountsInitContainer:/i\ \ \ \ \ \ \ \ \ \ \ \ - /$volumeName" "$variable"
sed -i "/volumeMountsInitContainer:/a\ \ \ \ \ \ \ \ \ \ \ \ - name: $volumeName\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ mountPath: /$volumeName" "$variable"
# Workaround for the database volume
if [ "$volumeName" = nextcloud-aio-database ]; then
sed -i "/mountPath: \/var\/lib\/postgresql\/data/a\ \ \ \ \ \ \ \ \ \ \ \ \ \ subPath: data" "$variable"
Expand All @@ -128,6 +139,8 @@ for variable in "${DEPLOYMENTS[@]}"; do

fi
done
sed -i "s|volumeMountsInitContainer:|volumeMounts:|" "$variable"
sed -i "s|volumeMountsInitRmLostFound:|volumeMounts:|" "$variable"
if grep -q claimName "$variable"; then
claimNames="$(grep claimName "$variable")"
mapfile -t claimNames <<< "$claimNames"
Expand Down

0 comments on commit 0ada346

Please sign in to comment.