From a56fc05409b513e5a562a4a415fce0bd5fc2c41b Mon Sep 17 00:00:00 2001 From: Torsten Walter Date: Mon, 17 Jun 2019 21:49:50 +0200 Subject: [PATCH] only install casc support plugin when needed (#14862) The latest released version of the configuration as code support plugin is 1.19 for newer versions of the configuration as code plugin it's no longer needed. Using semver compare to check for this condition. Signed-off-by: Torsten Walter --- stable/jenkins/Chart.yaml | 2 +- stable/jenkins/templates/config.yaml | 4 +++- stable/jenkins/values.yaml | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/stable/jenkins/Chart.yaml b/stable/jenkins/Chart.yaml index 4963b074e7..a76ec14acc 100755 --- a/stable/jenkins/Chart.yaml +++ b/stable/jenkins/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: jenkins home: https://jenkins.io/ -version: 1.2.2 +version: 1.3.0 appVersion: lts description: Open source continuous integration server. It supports multiple SCM tools including CVS, Subversion and Git. It can execute Apache Ant and Apache Maven-based diff --git a/stable/jenkins/templates/config.yaml b/stable/jenkins/templates/config.yaml index 9a820f5f6c..85281c9c4e 100644 --- a/stable/jenkins/templates/config.yaml +++ b/stable/jenkins/templates/config.yaml @@ -323,8 +323,10 @@ data: {{- if not (contains "configuration-as-code" (quote .Values.master.installPlugins)) }} configuration-as-code:{{ .Values.master.JCasC.pluginVersion }} {{- end }} - {{- if not (contains "configuration-as-code-support" (quote .Values.master.installPlugins)) }} + {{- if semverCompare "<=1.19" (printf "%v" .Values.master.JCasC.pluginVersion) }} + {{- if not (contains "configuration-as-code-support" (quote .Values.master.installPlugins)) }} configuration-as-code-support:{{ .Values.master.JCasC.supportPluginVersion }} + {{- end }} {{- end }} {{- end }} {{- end }} diff --git a/stable/jenkins/values.yaml b/stable/jenkins/values.yaml index e659c44cee..d2a7d9d1b6 100644 --- a/stable/jenkins/values.yaml +++ b/stable/jenkins/values.yaml @@ -194,8 +194,10 @@ master: # etc. Best reference is https:///configuration-as-code/reference. The example below creates a welcome message: JCasC: enabled: false - pluginVersion: 1.5 - supportPluginVersion: 1.5 + pluginVersion: 1.19 + # it's only used when plugin version is <=1.18 for later version the + # configuration as code support plugin is no longer needed + supportPluginVersion: 1.19 configScripts: welcome-message: | jenkins: