From b7e45457345f6c8eaeb3d773fca8208776e2695a Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Thu, 18 Dec 2025 10:41:37 -0300 Subject: [PATCH] Apply Jenkins theme via init script --- services/jenkins/helmrelease.yaml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/services/jenkins/helmrelease.yaml b/services/jenkins/helmrelease.yaml index 74587db..a5c2af3 100644 --- a/services/jenkins/helmrelease.yaml +++ b/services/jenkins/helmrelease.yaml @@ -170,6 +170,23 @@ spec: println("Failed to configure OIDC realm: ${e}") throw e } + theme.groovy: | + import jenkins.model.Jenkins + import org.codefirst.SimpleThemeDecorator + + def instance = Jenkins.get() + def decorators = instance.getExtensionList(SimpleThemeDecorator.class) + + if (decorators?.size() > 0) { + def theme = decorators[0] + theme.setCssUrl("https://jenkins-contrib-themes.github.io/jenkins-material-theme/dist/material-ocean.css") + theme.setJsUrl("") + theme.setTheme("") + instance.save() + println("Applied simple-theme-plugin dark theme") + } else { + println("simple-theme-plugin not installed; skipping theme configuration") + } JCasC: defaultConfig: false securityRealm: "" @@ -244,10 +261,6 @@ spec: creationOfLegacyTokenEnabled: false tokenGenerationOnCreationEnabled: false usageStatisticsEnabled: true - unclassified: - simple-theme-plugin: - elements: - - cssUrl: "https://jenkins-contrib-themes.github.io/jenkins-material-theme/dist/material-ocean.css" creds.yaml: | credentials: system: