forge: try moving themes over in init container script

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
This commit is contained in:
Ryan Lerch
2025-10-31 12:51:19 +10:00
parent a5c90033af
commit cf6a0d2e80
2 changed files with 29 additions and 1 deletions

View File

@@ -7,7 +7,7 @@
- include_tasks: create-forgejo-namespace.yaml
- include_tasks: create-forgejo-pvc.yaml
- include_tasks: create-postgres-operator-config.yaml
# - include_tasks: create-custom-theme-configmap.yaml
- include_tasks: create-custom-theme-configmap.yaml
# - include_tasks: deploy-valkey.yaml
- include_tasks: call-helm.yaml
- include_tasks: create-forgejo-runnerhost-vm.yaml

View File

@@ -323,7 +323,14 @@ persistence:
helm.sh/resource-policy: keep
## @param extraVolumes Additional volumes to mount to the Forgejo deployment
{% if env == "staging" %}
extraVolumes:
- name: custom-theme-vol
configMap:
name: forgejo-custom-theme
{% else %}
extraVolumes: []
{% endif %}
# - name: postgres-ssl-vol
# secret:
# secretName: gitea-postgres-ssl
@@ -332,7 +339,14 @@ extraVolumes: []
extraContainerVolumeMounts: []
## @param extraInitVolumeMounts Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration.
{% if env == "staging" %}
extraInitVolumeMounts:
- name: custom-theme-vol
mountPath: /tmp/themes
readOnly: true
{% else %}
extraInitVolumeMounts: []
{% endif %}
## @deprecated The extraVolumeMounts variable has been split two:
## - extraContainerVolumeMounts
@@ -346,7 +360,21 @@ extraVolumeMounts: []
## @section Init
## @param initPreScript Bash shell script copied verbatim to the start of the init-container.
{% if env == "staging" %}
initPreScript: |
# Copy custom themes from ConfigMap to main data directory
echo "Installing custom Fedora themes..."
mkdir -p /data/gitea/public/assets/css
if [ -d "/tmp/themes" ]; then
cp -r /tmp/themes/*.css /data/gitea/public/assets/css/ || true
echo "Themes copied successfully"
ls -la /data/gitea/public/assets/css/
else
echo "No themes found in /tmp/themes"
fi
{% else %}
initPreScript: ''
{% endif %}
#
# initPreScript: |
# mkdir -p /data/git/.postgresql