Skip to content

Commit

Permalink
Switch to using plugin manager (#117)
Browse files Browse the repository at this point in the history
Once 2.1.1 is available in images, we can start using the plugin manager

Signed-off-by: Gavin Mogan <[email protected]>
  • Loading branch information
halkeye authored Nov 6, 2020
1 parent 072a589 commit 939fa1f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
4 changes: 4 additions & 0 deletions charts/jenkins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0.

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.

## 2.17.0

Add support for plugin-installation-manager-tool

## 2.16.0

Added Startup probe for Jenkins pod when Kubernetes cluster is 1.16 or newer
Expand Down
2 changes: 1 addition & 1 deletion charts/jenkins/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: jenkins
home: https://jenkins.io/
version: 2.16.0
version: 2.17.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
Expand Down
9 changes: 8 additions & 1 deletion charts/jenkins/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,14 @@ data:
# Install missing plugins
cp /var/jenkins_config/plugins.txt {{ .Values.master.jenkinsHome }};
rm -rf {{ .Values.master.jenkinsRef }}/plugins/*.lock
/usr/local/bin/install-plugins.sh `echo $(cat {{ .Values.master.jenkinsHome }}/plugins.txt)`;
version () { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
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
jenkins-plugin-cli --war {{ .Values.master.jenkinsRef }}/jenkins.war --plugin-file {{ .Values.master.jenkinsHome }}/plugins.txt;
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
jenkins-plugin-cli --war {{ .Values.master.jenkinsHome }}/jenkins.war --plugin-file {{ .Values.master.jenkinsHome }}/plugins.txt;
else
/usr/local/bin/install-plugins.sh `echo $(cat {{ .Values.master.jenkinsHome }}/plugins.txt)`;
fi
echo "copy plugins to shared volume"
# Copy plugins to shared volume
yes n | cp -i {{ .Values.master.jenkinsRef }}/plugins/* /var/jenkins_plugins/;
Expand Down
18 changes: 16 additions & 2 deletions charts/jenkins/tests/config-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ tests:
# Install missing plugins
cp /var/jenkins_config/plugins.txt /var/jenkins_home;
rm -rf /usr/share/jenkins/ref/plugins/*.lock
/usr/local/bin/install-plugins.sh `echo $(cat /var/jenkins_home/plugins.txt)`;
version () { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
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
jenkins-plugin-cli --war /usr/share/jenkins/ref/jenkins.war --plugin-file /var/jenkins_home/plugins.txt;
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
jenkins-plugin-cli --war /var/jenkins_home/jenkins.war --plugin-file /var/jenkins_home/plugins.txt;
else
/usr/local/bin/install-plugins.sh `echo $(cat /var/jenkins_home/plugins.txt)`;
fi
echo "copy plugins to shared volume"
# Copy plugins to shared volume
yes n | cp -i /usr/share/jenkins/ref/plugins/* /var/jenkins_plugins/;
Expand Down Expand Up @@ -75,7 +82,14 @@ tests:
# Install missing plugins
cp /var/jenkins_config/plugins.txt /var/jenkins_home;
rm -rf /usr/share/jenkins/ref/plugins/*.lock
/usr/local/bin/install-plugins.sh `echo $(cat /var/jenkins_home/plugins.txt)`;
version () { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
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
jenkins-plugin-cli --war /usr/share/jenkins/ref/jenkins.war --plugin-file /var/jenkins_home/plugins.txt;
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
jenkins-plugin-cli --war /var/jenkins_home/jenkins.war --plugin-file /var/jenkins_home/plugins.txt;
else
/usr/local/bin/install-plugins.sh `echo $(cat /var/jenkins_home/plugins.txt)`;
fi
echo "copy plugins to shared volume"
# Copy plugins to shared volume
yes n | cp -i /usr/share/jenkins/ref/plugins/* /var/jenkins_plugins/;
Expand Down
2 changes: 1 addition & 1 deletion charts/jenkins/tests/jenkins-master-deployment-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ tests:
template:
metadata:
annotations:
checksum/config: 3ba23f433d321215bc22cf8295c0a264594bc1675408af2f710e36b86c1c1f38
checksum/config: a4e9178adb6ab11b7bdaaca51a566701e8f8f3a2f7a803c87721b1c403b03d04
labels:
app.kubernetes.io/component: jenkins-master
app.kubernetes.io/instance: my-release
Expand Down

0 comments on commit 939fa1f

Please sign in to comment.