Skip to content

Commit 9782562

Browse files
Upgrade Jenkins and polishing
Minimize Jenkins plugins. Deprecated: workflow-cps-global-lib html5-notifier-plugin Provided by Jenkins image: configuration-as-code kubernetes Likely not strictly necessary: external-monitor-job matrix-auth lockable-resources Co-authored-by: Niklas Hußmann <[email protected]>
1 parent f85ca54 commit 9782562

File tree

9 files changed

+81
-84
lines changed

9 files changed

+81
-84
lines changed

README.md

-7
Original file line numberDiff line numberDiff line change
@@ -830,13 +830,6 @@ Jenkins is available at
830830
* http://localhost:9090 (k3d)
831831
* `scripts/get-remote-url jenkins default` (remote k8s)
832832

833-
You can enable browser notifications about build results via a button in the lower right corner of Jenkins Web UI.
834-
835-
Note that this only works when using `localhost` or `https://`.
836-
837-
<img src="docs/jenkins-enable-notifications.png" alt="Enable Jenkins Notifications" width="300" >
838-
<img src="docs/jenkins-example-notification.png" alt="Example of a Jenkins browser notifications" width="300" >
839-
840833
###### External Jenkins
841834

842835
You can set an external jenkins server via the following parameters when applying the playground.

docs/developers.md

+35
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,41 @@ Jenkins.instance.pluginManager.activePlugins.sort().each {
114114
* Make sure you have updated `plugins.txt` with working versions of the plugins
115115
* commit and push changes to your feature-branch and submit a pr
116116

117+
Note that `plugins.txt` contains the whole dependency tree, including transitive plugin dependencies.
118+
The bare minimum of plugins that are needed is this:
119+
120+
```shell
121+
docker-workflow # Used in example builds
122+
git # Used in example builds
123+
junit # Used in example builds
124+
pipeline-utility-steps # Used in example builds, by gitops-build-lib
125+
pipeline-stage-view # Only necessary for better visualization of the builds
126+
prometheus # Necessary to fill Jenkins dashboard in Grafana
127+
scm-manager # Used in example builds
128+
workflow-aggregator # Pipelines plugin, used in example builds
129+
```
130+
131+
Note that, when running locally we also need `kubernetes` and `configuration-as-code` but these are contained in [our
132+
jenkins helm image](https://github.com/cloudogu/jenkins-helm-image/blob/5.8.1-1/Dockerfile#L2) (extracted from the
133+
[corresponding helm chart version](https://github.com/jenkinsci/helm-charts/blob/jenkins-5.8.1/charts/jenkins/values.yaml#L406-L409)).
134+
135+
136+
### Updating all plugins
137+
To get a minimal list of plugins, start an empty jenkins that uses [the base image of our image](https://github.com/cloudogu/jenkins-helm-image/blob/main/Dockerfile):
138+
139+
```shell
140+
docker run --rm -v $RANDOM-tmp-jenkins:/var/jenkins_home jenkins/jenkins:2.479.2-jdk17
141+
```
142+
We need a volume to persist the plugins when jenkins restarts.
143+
(These can be cleaned up afterwards like so: `docker volume ls -q | grep jenkins | xargs -I {} docker volume rm {}`).
144+
145+
Then
146+
* manually install the bare minimum of plugins mentioned above
147+
* extract the plugins using the groovy console as mentioned above
148+
* Write the output into `plugins.txt`
149+
150+
We should automate this!
151+
117152
## Local development
118153

119154
* Run locally

docs/jenkins-enable-notifications.png

-17.5 KB
Binary file not shown.

docs/jenkins-example-notification.png

-17.3 KB
Binary file not shown.

scripts/jenkins/plugins/plugins.txt

+41-71
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,74 @@
1-
ace-editor:1.1
2-
antisamy-markup-formatter:162.v0e6ec0fcfcf6
31
apache-httpcomponents-client-4-api:4.5.14-208.v438351942757
4-
apache-httpcomponents-client-5-api:5.3.1-110.v77252fb_d4da_5
5-
asm-api:9.7-33.v4d23ef79fcc8
2+
asm-api:9.7.1-97.v4cc844130d97
63
authentication-tokens:1.119.v50285141b_7e1
74
bootstrap5-api:5.3.3-1
8-
bouncycastle-api:2.30.1.78.1-248.ve27176eb_46cb_
9-
branch-api:2.1178.v969d9eb_c728e
5+
bouncycastle-api:2.30.1.79-254.vfdb_814e7791e
6+
branch-api:2.1202.vc51412f3ed84
107
caffeine-api:3.1.8-133.v17b_1ff2e0599
11-
checks-api:2.2.0
12-
cloud-stats:336.v788e4055508b_
13-
cloudbees-folder:6.942.vb_43318a_156b_2
14-
command-launcher:115.vd8b_301cc15d0
8+
checks-api:2.2.1
9+
cloudbees-folder:6.975.v4161e479479f
1510
commons-compress-api:1.26.1-2
16-
commons-lang3-api:3.16.0-82.ve2b_07d659d95
11+
commons-lang3-api:3.17.0-84.vb_b_938040b_078
1712
commons-text-api:1.12.0-129.v99a_50df237f7
18-
configuration-as-code:1849.v3a_d20568000a_
19-
credentials:1371.vfee6b_095f0a_3
20-
credentials-binding:681.vf91669a_32e45
21-
data-tables-api:2.1.4-1
22-
display-url-api:2.204.vf6fddd8a_8b_e9
23-
docker-commons:443.v921729d5611d
24-
docker-java-api:3.3.6-90.ve7c5c7535ddd
25-
docker-plugin:1.6.2
13+
credentials:1405.vb_cda_74a_f8974
14+
credentials-binding:687.v619cb_15e923f
15+
display-url-api:2.209.v582ed814ff2f
16+
docker-commons:445.v6b_646c962a_94
2617
docker-workflow:580.vc0c340686b_54
27-
durable-task:568.v8fb_5c57e8417
28-
echarts-api:5.5.1-1
18+
durable-task:581.v299a_5609d767
19+
echarts-api:5.5.1-5
2920
eddsa-api:0.3.0-4.v84c6f0f4969e
30-
external-monitor-job:215.v2e88e894db_f8
31-
font-awesome-api:6.6.0-1
32-
git:5.4.1
33-
git-client:5.0.0
34-
git-server:126.v0d945d8d2b_39
35-
gson-api:2.11.0-41.v019fcf6125dc
36-
html5-notifier-plugin:1.5
37-
instance-identity:185.v303dc7c645f9
21+
font-awesome-api:6.6.0-2
22+
git:5.7.0
23+
git-client:6.1.0
24+
gson-api:2.11.0-85.v1f4e87273c33
25+
instance-identity:201.vd2a_b_5a_468a_a_6
3826
ionicons-api:74.v93d5eb_813d5f
3927
jackson2-api:2.17.0-379.v02de8ec9f64c
4028
jakarta-activation-api:2.1.3-1
4129
jakarta-mail-api:2.1.3-1
4230
javax-activation-api:1.2.0-7
43-
javax-mail-api:1.6.2-10
4431
jaxb:2.3.9-1
45-
jdk-tool:80.v8a_dee33ed6f0
46-
joda-time-api:2.12.7-29.v5a_b_e3a_82269a_
32+
joda-time-api:2.13.0-93.v9934da_29b_a_e9
4733
jquery3-api:3.7.1-2
48-
jsch:0.2.16-86.v42e010d9484b_
49-
json-api:20240303-41.v94e11e6de726
50-
json-path-api:2.9.0-58.v62e3e85b_a_655
51-
junit:1296.vb_f538b_c88630
52-
kubernetes:4285.v50ed5f624918
53-
kubernetes-client-api:6.10.0-240.v57880ce8b_0b_2
54-
kubernetes-credentials:189.v90a_488b_d1d65
55-
ldap:725.v3cb_b_711b_1a_ef
56-
lockable-resources:1255.vf48745da_35d0
57-
mailer:472.vf7c289a_4b_420
58-
matrix-auth:3.2.2
59-
matrix-project:832.va_66e270d2946
60-
metrics:4.2.21-451.vd51df8df52ec
61-
mina-sshd-api-common:2.13.2-125.v200281b_61d59
62-
mina-sshd-api-core:2.13.2-125.v200281b_61d59
63-
okhttp-api:4.11.0-172.vda_da_1feeb_c6e
64-
pam-auth:1.11
34+
json-api:20241224-119.va_dca_a_b_ea_7da_5
35+
junit:1312.v1a_235a_b_94a_31
36+
mailer:489.vd4b_25144138f
37+
metrics:4.2.21-458.vcf496cb_839e4
38+
mina-sshd-api-common:2.14.0-138.v6341ee58e1df
39+
mina-sshd-api-core:2.14.0-138.v6341ee58e1df
40+
okhttp-api:4.11.0-183.va_87fc7a_89810
6541
pipeline-build-step:540.vb_e8849e1a_b_d8
6642
pipeline-graph-analysis:216.vfd8b_ece330ca_
67-
pipeline-groovy-lib:730.ve57b_34648c63
43+
pipeline-groovy-lib:745.vdf6077913de0
6844
pipeline-input-step:495.ve9c153f6067b_
6945
pipeline-milestone-step:119.vdfdc43fc3b_9a_
70-
pipeline-model-api:2.2214.vb_b_34b_2ea_9b_83
71-
pipeline-model-definition:2.2214.vb_b_34b_2ea_9b_83
72-
pipeline-model-extensions:2.2214.vb_b_34b_2ea_9b_83
46+
pipeline-model-api:2.2218.v56d0cda_37c72
47+
pipeline-model-definition:2.2218.v56d0cda_37c72
48+
pipeline-model-extensions:2.2218.v56d0cda_37c72
7349
pipeline-rest-api:2.34
7450
pipeline-stage-step:312.v8cd10304c27a_
75-
pipeline-stage-tags-metadata:2.2214.vb_b_34b_2ea_9b_83
51+
pipeline-stage-tags-metadata:2.2218.v56d0cda_37c72
7652
pipeline-stage-view:2.34
77-
pipeline-utility-steps:2.17.0
53+
pipeline-utility-steps:2.18.0
7854
plain-credentials:183.va_de8f1dd5a_2b_
79-
plugin-util-api:4.1.0
80-
popper-api:1.16.1-3
81-
prism-api:1.29.0-17
82-
prometheus:784.vea_eca_f6592eb_
83-
scm-api:696.v778d637b_a_762
55+
plugin-util-api:5.1.0
56+
prometheus:801.v98e119d8eeda_
57+
scm-api:698.v8e3b_c788f0a_6
8458
scm-manager:1.9.4
85-
script-security:1354.va_70a_fe478c7f
86-
snakeyaml-api:2.2-121.v5a_68b_9300b_d4
87-
ssh-credentials:343.v884f71d78167
88-
ssh-slaves:2.973.v0fa_8c0dea_f9f
89-
sshd:3.330.vc866a_8389b_58
59+
script-security:1369.v9b_98a_4e95b_2d
60+
snakeyaml-api:2.3-123.v13484c65210a_
61+
ssh-credentials:349.vb_8b_6b_9709f5b_
9062
structs:338.v848422169819
91-
token-macro:400.v35420b_922dcb_
9263
trilead-api:2.147.vb_73cc728a_32e
9364
variant:60.v7290fc0eb_b_cd
9465
workflow-aggregator:600.vb_57cdd26fdd7
9566
workflow-api:1336.vee415d95c521
9667
workflow-basic-steps:1058.vcb_fc1e3a_21a_9
97-
workflow-cps:3953.v19f11da_8d2fa_
98-
workflow-cps-global-lib:612.v55f2f80781ef
99-
workflow-durable-task-step:1371.vb_7cec8f3b_95e
100-
workflow-job:1436.vfa_244484591f
68+
workflow-cps:4007.vd705fc76a_34e
69+
workflow-durable-task-step:1398.vf6c9e89e5988
70+
workflow-job:1472.ve4d5eca_143c4
10171
workflow-multibranch:795.ve0cb_1f45ca_9a_
10272
workflow-scm-step:427.v4ca_6512e7df1
10373
workflow-step-api:678.v3ee58b_469476
104-
workflow-support:920.v59f71ce16f04
74+
workflow-support:936.v9fa_77211ca_e1

src/main/groovy/com/cloudogu/gitops/config/ApplicationConfigurator.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class ApplicationConfigurator {
153153

154154
if (newConfig.application.baseUrl) {
155155
newConfig.jenkins.ingress = new URL(injectSubdomain('jenkins',
156-
newConfig.application.baseUrl as String, newConfig.application.urlSeparatorHyphen as Boolean)).host
156+
newConfig.application.baseUrl, newConfig.application.urlSeparatorHyphen)).host
157157
}
158158
}
159159

src/main/groovy/com/cloudogu/gitops/config/Config.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class Config {
203203
HelmConfigWithValues helm = new HelmConfigWithValues(
204204
chart: 'jenkins',
205205
repoURL: 'https://charts.jenkins.io',
206-
version: '5.5.11')
206+
version: '5.8.1')
207207
}
208208

209209
static class ScmmSchema {

src/main/groovy/com/cloudogu/gitops/features/Jenkins.groovy

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Jenkins extends Feature {
6868
void enable() {
6969

7070
if (config.jenkins.internal) {
71-
// Mark the first node for Jenkins and agents. See jenkins/values.yaml "agent.workingDir" for details.
71+
// Mark the first node for Jenkins and agents. See jenkins/values.ftl.yaml "agent.workingDir" for details.
7272
// Remove first (in case new nodes were added)
7373
k8sClient.labelRemove('node', '--all', '', 'node')
7474
def nodeName = k8sClient.waitForNode().replace('node/', '')
@@ -210,8 +210,8 @@ class Jenkins extends Feature {
210210
}
211211

212212
if (!gid) {
213-
log.warn 'Unable to determine Docker Group ID (GID). Jenkins Agent pods will run as root user (UID 0)!\n' +
214-
"Group docker not found in /etc/group:\n${etcGroup}"
213+
log.warn('Unable to determine Docker Group ID (GID). Jenkins Agent pods will run as root user (UID 0)!\n' +
214+
"Group docker not found in /etc/group:\n${etcGroup}")
215215
return ''
216216
} else {
217217
log.debug("Using Docker Group ID (GID) ${gid} for Jenkins Agent pods")

src/test/groovy/com/cloudogu/gitops/features/JenkinsTest.groovy

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import groovy.yaml.YamlSlurper
1313
import org.junit.jupiter.api.BeforeEach
1414
import org.junit.jupiter.api.Test
1515
import org.mockito.ArgumentCaptor
16-
1716
import java.nio.file.Path
1817

1918
import static org.assertj.core.api.Assertions.assertThat

0 commit comments

Comments
 (0)