Changes for page Jenkinsfile

Last modified by Gábor Mándity on 2025/09/18 08:09

From version 2.1
edited by Gábor Mándity
on 2025/09/18 08:09
Change comment: There is no comment for this version
To version 1.1
edited by DOaaS Operator
on 2025/02/05 11:33
Change comment: Imported from XAR

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.gabormandityt-systemscom
1 +xwiki:XWiki.sdcloud-admin-0
Content
... ... @@ -23,7 +23,8 @@
23 23  
24 24  At the top of the Jenkinsfile add a buildDiscarder to the properties to let Jenkins delete old artifacts or complete job executions:
25 25  
26 -{{code language="groovy" title="ℹ **Example**"}}
26 +{{code language="groovy" title="ℹ **Example**
27 + "}}
27 27  properties([
28 28   buildDiscarder(logRotator(numToKeepStr: '50', artifactNumToKeepStr: '5'))
29 29  ])
... ... @@ -40,7 +40,8 @@
40 40  
41 41  Instead of having pipelines just triggered on source code changes you can also use cron syntax to define dates and times that shoud automatically trigger the pipeline.
42 42  
43 -{{code language="groovy" title="**ℹ Example**"}}
44 +{{code language="groovy" title="**ℹ Example**
45 + "}}
44 44  properties([
45 45   pipelineTriggers([cron('TZ=Europe/Berlin \n 00 08 * * 1-5')])
46 46  ])
... ... @@ -54,7 +54,8 @@
54 54  
55 55  At the top of the Jenkinsfile add a durabilityHint to the properties:
56 56  
57 -{{code language="groovy" title="**ℹ Example**"}}
59 +{{code language="groovy" title="**ℹ Example**
60 + "}}
58 58  properties([
59 59   durabilityHint('PERFORMANCE_OPTIMIZED')
60 60  ])
... ... @@ -80,7 +80,8 @@
80 80  
81 81  Supported symbolic name is 'maven'. The exact version can be looked up at the start page of your Jenkins, e.g. [[https:~~/~~/CUSTOMER.devops.t-systems.net/jenkins/>>url:https://CUSTOMER.devops.t-systems.net/jenkins/||shape="rect"]]
82 82  
83 -{{code language="groovy" title="ℹ **Scripted Pipeline**"}}
86 +{{code language="groovy" title="ℹ **Scripted Pipeline**
87 + "}}
84 84  withMaven(maven: 'maven')
85 85  {
86 86   sh 'mvn --version'
... ... @@ -95,7 +95,8 @@
95 95  
96 96  The following examples use jdk17.
97 97  
98 -{{code language="groovy" title="**ℹ Scripted Pipeline**"}}
102 +{{code language="groovy" title="**ℹ Scripted Pipeline**
103 + "}}
99 99  env.JAVA_HOME = "${tool 'jdk17'}"
100 100  env.PATH="${env.JAVA_HOME}/bin:${env.PATH}"
101 101  sh 'java -version'
... ... @@ -103,7 +103,8 @@
103 103  
104 104  When you use the [[doc:Jenkins.Jenkins Shared Library.WebHome]] you simply do
105 105  
106 -{{code language="groovy" title="**ℹ Scripted Pipeline**"}}
111 +{{code language="groovy" title="**ℹ Scripted Pipeline**
112 + "}}
107 107  @Library('sdcloud') _
108 108  
109 109  sdcPipeline(jdk: 'jdk17')
... ... @@ -117,7 +117,8 @@
117 117  
118 118  The following examples use 'nodejs18'.
119 119  
120 -{{code language="groovy" title="**ℹ Scripted Pipeline**"}}
126 +{{code language="groovy" title="**ℹ Scripted Pipeline**
127 + "}}
121 121  env.NODEJS_HOME = "${tool 'nodejs18'}"
122 122  env.PATH="${env.NODEJS_HOME}/bin:${env.PATH}"
123 123  sh 'node --version'
... ... @@ -126,7 +126,8 @@
126 126  
127 127  When you use the [[doc:Jenkins.Jenkins Shared Library.WebHome]] you simply do
128 128  
129 -{{code language="groovy" title="**ℹ Scripted Pipeline**"}}
136 +{{code language="groovy" title="**ℹ Scripted Pipeline**
137 + "}}
130 130  @Library('sdcloud') _
131 131  
132 132  sdcPipeline(nodejs: 'nodejs18')
... ... @@ -133,26 +133,3 @@
133 133  {{/code}}
134 134  
135 135  to use the nodejs version of your choice. See [[doc:Jenkins.Jenkins Shared Library.WebHome||anchor="PipelineCustomization"]] for more information.
136 -
137 -== Golang ==
138 -
139 -The supported symbolic names are listed at the start page of your Jenkins (e.g. [[https:~~/~~/CUSTOMER.devops.t-systems.net/jenkins/>>url:https://CUSTOMER.devops.t-systems.net/jenkins/||shape="rect"]]) and start with 'go'. As an example 'go1.25' would be referring to the latest release of Golang v1.25. The short name 'go' is usually set to the recommended LTS version of Golang.
140 -
141 -The following examples use 'go1.25'.
142 -
143 -{{code language="groovy" title="**ℹ Scripted Pipeline**"}}
144 -def root = tool type: 'go', name: go1.25
145 -withEnv(["GOROOT=${root}", "PATH+GO=${root}/bin"]) {
146 - sh 'go version'
147 -}
148 -{{/code}}
149 -
150 -When you use the [[doc:Jenkins.Jenkins Shared Library.WebHome]] you simply do
151 -
152 -{{code language="groovy" title="**ℹ Scripted Pipeline**"}}
153 -@Library('sdcloud') _
154 -
155 -sdcPipeline(go: 'go1.25')
156 -{{/code}}
157 -
158 -to use the go version of your choice. See [[doc:Jenkins.Jenkins Shared Library.WebHome||anchor="PipelineCustomization"]] for more information.