diff --git a/roles/openshift-apps/forgejo/tasks/main.yaml b/roles/openshift-apps/forgejo/tasks/main.yaml index 37856d6178..80100f44be 100644 --- a/roles/openshift-apps/forgejo/tasks/main.yaml +++ b/roles/openshift-apps/forgejo/tasks/main.yaml @@ -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 diff --git a/roles/openshift-apps/forgejo/templates/values.yaml.j2 b/roles/openshift-apps/forgejo/templates/values.yaml.j2 index 5565413879..a0aeb19fa1 100644 --- a/roles/openshift-apps/forgejo/templates/values.yaml.j2 +++ b/roles/openshift-apps/forgejo/templates/values.yaml.j2 @@ -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