Skip to content

Commit 939fa1f

Browse files
authored
Switch to using plugin manager (#117)
Once 2.1.1 is available in images, we can start using the plugin manager Signed-off-by: Gavin Mogan <git@gavinmogan.com>
1 parent 072a589 commit 939fa1f

5 files changed

Lines changed: 30 additions & 5 deletions

File tree

charts/jenkins/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0.
1010

1111
The change log until v1.5.7 was auto-generated based on git commits. Those entries include a reference to the git commit to be able to get more details.
1212

13+
## 2.17.0
14+
15+
Add support for plugin-installation-manager-tool
16+
1317
## 2.16.0
1418

1519
Added Startup probe for Jenkins pod when Kubernetes cluster is 1.16 or newer

charts/jenkins/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: jenkins
33
home: https://jenkins.io/
4-
version: 2.16.0
4+
version: 2.17.0
55
appVersion: lts
66
description: Open source continuous integration server. It supports multiple SCM tools
77
including CVS, Subversion and Git. It can execute Apache Ant and Apache Maven-based

charts/jenkins/templates/config.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,14 @@ data:
209209
# Install missing plugins
210210
cp /var/jenkins_config/plugins.txt {{ .Values.master.jenkinsHome }};
211211
rm -rf {{ .Values.master.jenkinsRef }}/plugins/*.lock
212-
/usr/local/bin/install-plugins.sh `echo $(cat {{ .Values.master.jenkinsHome }}/plugins.txt)`;
212+
version () { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
213+
if [ -f "{{ .Values.master.jenkinsRef }}/jenkins.war" ] && [ -n "$(command -v jenkins-plugin-cli)" 2>/dev/null ] && [ $(version $(jenkins-plugin-cli --version)) -ge $(version "2.1.1") ]; then
214+
jenkins-plugin-cli --war {{ .Values.master.jenkinsRef }}/jenkins.war --plugin-file {{ .Values.master.jenkinsHome }}/plugins.txt;
215+
elif [ -f "{{ .Values.master.jenkinsHome }}/jenkins.war" ] && [ -n "$(command -v jenkins-plugin-cli)" 2>/dev/null ] && [ $(version $(jenkins-plugin-cli --version)) -ge $(version "2.1.1") ]; then
216+
jenkins-plugin-cli --war {{ .Values.master.jenkinsHome }}/jenkins.war --plugin-file {{ .Values.master.jenkinsHome }}/plugins.txt;
217+
else
218+
/usr/local/bin/install-plugins.sh `echo $(cat {{ .Values.master.jenkinsHome }}/plugins.txt)`;
219+
fi
213220
echo "copy plugins to shared volume"
214221
# Copy plugins to shared volume
215222
yes n | cp -i {{ .Values.master.jenkinsRef }}/plugins/* /var/jenkins_plugins/;

charts/jenkins/tests/config-test.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@ tests:
2727
# Install missing plugins
2828
cp /var/jenkins_config/plugins.txt /var/jenkins_home;
2929
rm -rf /usr/share/jenkins/ref/plugins/*.lock
30-
/usr/local/bin/install-plugins.sh `echo $(cat /var/jenkins_home/plugins.txt)`;
30+
version () { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
31+
if [ -f "/usr/share/jenkins/ref/jenkins.war" ] && [ -n "$(command -v jenkins-plugin-cli)" 2>/dev/null ] && [ $(version $(jenkins-plugin-cli --version)) -ge $(version "2.1.1") ]; then
32+
jenkins-plugin-cli --war /usr/share/jenkins/ref/jenkins.war --plugin-file /var/jenkins_home/plugins.txt;
33+
elif [ -f "/var/jenkins_home/jenkins.war" ] && [ -n "$(command -v jenkins-plugin-cli)" 2>/dev/null ] && [ $(version $(jenkins-plugin-cli --version)) -ge $(version "2.1.1") ]; then
34+
jenkins-plugin-cli --war /var/jenkins_home/jenkins.war --plugin-file /var/jenkins_home/plugins.txt;
35+
else
36+
/usr/local/bin/install-plugins.sh `echo $(cat /var/jenkins_home/plugins.txt)`;
37+
fi
3138
echo "copy plugins to shared volume"
3239
# Copy plugins to shared volume
3340
yes n | cp -i /usr/share/jenkins/ref/plugins/* /var/jenkins_plugins/;
@@ -75,7 +82,14 @@ tests:
7582
# Install missing plugins
7683
cp /var/jenkins_config/plugins.txt /var/jenkins_home;
7784
rm -rf /usr/share/jenkins/ref/plugins/*.lock
78-
/usr/local/bin/install-plugins.sh `echo $(cat /var/jenkins_home/plugins.txt)`;
85+
version () { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
86+
if [ -f "/usr/share/jenkins/ref/jenkins.war" ] && [ -n "$(command -v jenkins-plugin-cli)" 2>/dev/null ] && [ $(version $(jenkins-plugin-cli --version)) -ge $(version "2.1.1") ]; then
87+
jenkins-plugin-cli --war /usr/share/jenkins/ref/jenkins.war --plugin-file /var/jenkins_home/plugins.txt;
88+
elif [ -f "/var/jenkins_home/jenkins.war" ] && [ -n "$(command -v jenkins-plugin-cli)" 2>/dev/null ] && [ $(version $(jenkins-plugin-cli --version)) -ge $(version "2.1.1") ]; then
89+
jenkins-plugin-cli --war /var/jenkins_home/jenkins.war --plugin-file /var/jenkins_home/plugins.txt;
90+
else
91+
/usr/local/bin/install-plugins.sh `echo $(cat /var/jenkins_home/plugins.txt)`;
92+
fi
7993
echo "copy plugins to shared volume"
8094
# Copy plugins to shared volume
8195
yes n | cp -i /usr/share/jenkins/ref/plugins/* /var/jenkins_plugins/;

charts/jenkins/tests/jenkins-master-deployment-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ tests:
4545
template:
4646
metadata:
4747
annotations:
48-
checksum/config: 3ba23f433d321215bc22cf8295c0a264594bc1675408af2f710e36b86c1c1f38
48+
checksum/config: a4e9178adb6ab11b7bdaaca51a566701e8f8f3a2f7a803c87721b1c403b03d04
4949
labels:
5050
app.kubernetes.io/component: jenkins-master
5151
app.kubernetes.io/instance: my-release

0 commit comments

Comments
 (0)