| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 1 | =============== | 
 | 2 | Jenkins formula | 
 | 3 | =============== | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 4 |  | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 5 | Jenkins is an application that monitors executions of repeated jobs, such as | 
 | 6 | building a software project or jobs run by cron. | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 7 |  | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 8 | Setup jenkins client, works with Salt 2016.3+, supports pipeline workflow | 
 | 9 | projects only now. | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 10 |  | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 11 |  | 
| Ales Komarek | e5a1ed6 | 2016-08-27 12:02:48 +0200 | [diff] [blame] | 12 | Sample pillars | 
 | 13 | ============== | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 14 |  | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 15 | Master role | 
 | 16 | ----------- | 
| Ales Komarek | e5a1ed6 | 2016-08-27 12:02:48 +0200 | [diff] [blame] | 17 |  | 
 | 18 | Simple master with reverse proxy | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 19 |  | 
 | 20 | .. code-block:: yaml | 
 | 21 |  | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 22 |     nginx: | 
 | 23 |       server: | 
 | 24 |         site: | 
 | 25 |           jenkins: | 
 | 26 |             enabled: true | 
 | 27 |             type: nginx_proxy | 
 | 28 |             name: jenkins | 
 | 29 |             proxy: | 
 | 30 |               host: 127.0.0.1 | 
 | 31 |               port: 8080 | 
 | 32 |               protocol: http | 
 | 33 |             host: | 
 | 34 |               name: jenkins.example.com | 
 | 35 |               port: 80 | 
 | 36 |     jenkins: | 
 | 37 |       master: | 
 | 38 |         mode: EXCLUSIVE | 
| Filip Pytloun | 52b9c2c | 2016-01-28 13:45:57 +0100 | [diff] [blame] | 39 |         # Do not manage config.xml from Salt, use UI instead | 
 | 40 |         no_config: true | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 41 |         slaves: | 
 | 42 |           - name: slave01 | 
 | 43 |              label: pbuilder | 
 | 44 |              executors: 2 | 
 | 45 |           - name: slave02 | 
 | 46 |              label: image_builder | 
 | 47 |              mode: EXCLUSIVE | 
 | 48 |              executors: 2 | 
 | 49 |         views: | 
 | 50 |           - name: "Package builds" | 
 | 51 |             regex: "debian-build-.*" | 
 | 52 |           - name: "Contrail builds" | 
 | 53 |             regex: "contrail-build-.*" | 
 | 54 |           - name: "Aptly" | 
 | 55 |             regex: "aptly-.*" | 
 | 56 |         plugins: | 
 | 57 |         - name: slack | 
 | 58 |         - name: extended-choice-parameter | 
 | 59 |         - name: rebuild | 
 | 60 |         - name: test-stability | 
 | 61 |  | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 62 | Jenkins master with experimental plugin source support | 
| Ales Komarek | af967ee | 2016-08-31 19:38:50 +0200 | [diff] [blame] | 63 |  | 
 | 64 | .. code-block:: yaml | 
 | 65 |  | 
 | 66 |     jenkins: | 
 | 67 |       master: | 
 | 68 |         enabled: true | 
 | 69 |         update_site_url: 'http://updates.jenkins-ci.org/experimental/update-center.json' | 
 | 70 |  | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 71 | SMTP server settings | 
| Ales Komarek | af967ee | 2016-08-31 19:38:50 +0200 | [diff] [blame] | 72 |  | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 73 | .. code-block:: yaml | 
 | 74 |  | 
 | 75 |     jenkins: | 
 | 76 |       master: | 
 | 77 |         email: | 
 | 78 |           engine: "smtp" | 
 | 79 |           host: "smtp.domain.com" | 
 | 80 |           user: "user@domain.cz" | 
 | 81 |           password: "smtp-password" | 
 | 82 |           port: 25 | 
 | 83 |  | 
 | 84 | Script approvals | 
 | 85 |  | 
 | 86 | .. code-block:: yaml | 
 | 87 |  | 
 | 88 |     jenkins: | 
 | 89 |       master: | 
 | 90 |         approved_scripts: | 
 | 91 |         - method groovy.json.JsonSlurperClassic parseText java.lang.String | 
 | 92 |  | 
 | 93 | User enforcement | 
 | 94 |  | 
 | 95 | .. code-block:: yaml | 
 | 96 |  | 
 | 97 |     jenkins: | 
 | 98 |       master: | 
 | 99 |         user: | 
 | 100 |           admin: | 
 | 101 |             api_token: xxxxxxxxxx | 
 | 102 |             password: admin_password | 
 | 103 |             email: admin@domain.com | 
 | 104 |           user01: | 
 | 105 |             api_token: xxxxxxxxxx | 
 | 106 |             password: user_password | 
 | 107 |             email: user01@domain.com | 
 | 108 |  | 
 | 109 |  | 
 | 110 | Agent (slave) role | 
 | 111 | ------------------ | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 112 |  | 
 | 113 | .. code-block:: yaml | 
 | 114 |  | 
| Ales Komarek | 4c0bab1 | 2016-01-22 12:10:50 +0100 | [diff] [blame] | 115 |     jenkins: | 
 | 116 |       slave: | 
 | 117 |         master: | 
 | 118 |           host: jenkins.example.com | 
 | 119 |           port: 80 | 
| Michael KutĂ˝ | 37a3595 | 2016-06-10 23:51:36 +0200 | [diff] [blame] | 120 |           protocol: http | 
| Ales Komarek | 4c0bab1 | 2016-01-22 12:10:50 +0100 | [diff] [blame] | 121 |         user: | 
 | 122 |           name: jenkins_slave | 
 | 123 |           password: dexiech6AepohthaiHook2iesh7ol5ook4Ov3leid3yek6daid2ooNg3Ee2oKeYo | 
 | 124 |         gpg: | 
 | 125 |           keypair_id: A76882D3 | 
 | 126 |           public_key: | | 
 | 127 |             -----BEGIN PGP PUBLIC KEY BLOCK----- | 
 | 128 |             ... | 
 | 129 |           private_key: | | 
 | 130 |             -----BEGIN PGP PRIVATE KEY BLOCK----- | 
 | 131 |             ... | 
| Ales Komarek | af967ee | 2016-08-31 19:38:50 +0200 | [diff] [blame] | 132 |  | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 133 |  | 
 | 134 | Client role | 
 | 135 | ----------- | 
| Ales Komarek | e5a1ed6 | 2016-08-27 12:02:48 +0200 | [diff] [blame] | 136 |  | 
 | 137 | Simple client with workflow job definition | 
 | 138 |  | 
 | 139 | .. code-block:: yaml | 
 | 140 |  | 
 | 141 |     jenkins: | 
 | 142 |       client: | 
 | 143 |         master: | 
 | 144 |           host: jenkins.example.com | 
 | 145 |           port: 80 | 
 | 146 |           protocol: http | 
 | 147 |         job: | 
 | 148 |           jobname: | 
 | 149 |             type: workflow | 
 | 150 |             param: | 
 | 151 |               bool_param: | 
 | 152 |                 type: boolean | 
 | 153 |                 description: true/false | 
 | 154 |                 default: true | 
 | 155 |               string_param: | 
 | 156 |                 type: string | 
 | 157 |                 description: 1 liner | 
 | 158 |                 default: default_string | 
 | 159 |               text_param: | 
 | 160 |                 type: text | 
 | 161 |                 description: multi-liner | 
 | 162 |                 default: default_text | 
| Filip Pytloun | ebd4d17 | 2016-09-01 14:23:20 +0200 | [diff] [blame] | 163 |           jobname_scm: | 
 | 164 |             type: workflow-scm | 
 | 165 |             concurrent: false | 
 | 166 |             scm: | 
 | 167 |               type: git | 
 | 168 |               url: https://github.com/jenkinsci/docker.git | 
 | 169 |               branch: master | 
 | 170 |               script: Jenkinsfile | 
 | 171 |               github: | 
 | 172 |                 url: https://github.com/jenkinsci/docker | 
 | 173 |                 name: "Jenkins Docker Image" | 
 | 174 |             trigger: | 
 | 175 |               github: | 
 | 176 |               pollscm: | 
 | 177 |                 spec: "H/15 * * * *" | 
 | 178 |               reverse: | 
 | 179 |                 projects: | 
 | 180 |                  - test1 | 
 | 181 |                  - test2 | 
 | 182 |                 state: SUCCESS | 
 | 183 |             param: | 
 | 184 |               bool_param: | 
 | 185 |                 type: boolean | 
 | 186 |                 description: true/false | 
 | 187 |                 default: true | 
 | 188 |               string_param: | 
 | 189 |                 type: string | 
 | 190 |                 description: 1 liner | 
 | 191 |                 default: default_string | 
 | 192 |               text_param: | 
 | 193 |                 type: text | 
 | 194 |                 description: multi-liner | 
 | 195 |                 default: default_text | 
| Ales Komarek | e5a1ed6 | 2016-08-27 12:02:48 +0200 | [diff] [blame] | 196 |  | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 197 | Inline Groovy scripts | 
| Ales Komarek | e5a1ed6 | 2016-08-27 12:02:48 +0200 | [diff] [blame] | 198 |  | 
 | 199 | .. code-block:: yaml | 
 | 200 |  | 
 | 201 |     jenkins: | 
 | 202 |       client: | 
 | 203 |         job: | 
 | 204 |           test_workflow_jenkins_simple: | 
 | 205 |             type: workflow | 
 | 206 |             display_name: Test jenkins simple workflow | 
| Ales Komarek | 5b672fd | 2016-08-29 16:05:03 +0200 | [diff] [blame] | 207 |             script: | 
 | 208 |               content: | | 
 | 209 |                 node { | 
 | 210 |                    stage 'Stage 1' | 
 | 211 |                    echo 'Hello World 1' | 
 | 212 |                    stage 'Stage 2' | 
 | 213 |                    echo 'Hello World 2' | 
 | 214 |                 } | 
| Ales Komarek | e5a1ed6 | 2016-08-27 12:02:48 +0200 | [diff] [blame] | 215 |           test_workflow_jenkins_input: | 
 | 216 |             type: workflow | 
 | 217 |             display_name: Test jenkins workflow inputs | 
| Ales Komarek | 5b672fd | 2016-08-29 16:05:03 +0200 | [diff] [blame] | 218 |             script: | 
 | 219 |               content: | | 
 | 220 |                 node { | 
 | 221 |                    stage 'Enter string' | 
 | 222 |                    input message: 'Enter job parameters', ok: 'OK', parameters: [ | 
 | 223 |                      string(defaultValue: 'default', description: 'Enter a string.', name: 'string'), | 
 | 224 |                    ] | 
 | 225 |                    stage 'Enter boolean' | 
 | 226 |                    input message: 'Enter job parameters', ok: 'OK', parameters: [ | 
 | 227 |                      booleanParam(defaultValue: false, description: 'Select boolean.', name: 'Bool'), | 
 | 228 |                    ] | 
 | 229 |                    stage 'Enter text' | 
 | 230 |                    input message: 'Enter job parameters', ok: 'OK', parameters: [ | 
 | 231 |                      text(defaultValue: '', description: 'Enter multiline', name: 'Multiline') | 
 | 232 |                    ] | 
 | 233 |                 } | 
| Ales Komarek | e5a1ed6 | 2016-08-27 12:02:48 +0200 | [diff] [blame] | 234 |  | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 235 |  | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 236 | GIT controlled groovy scripts | 
| Ales Komarek | daf31f7 | 2016-08-29 11:00:13 +0200 | [diff] [blame] | 237 |  | 
 | 238 | .. code-block:: yaml | 
 | 239 |  | 
 | 240 |     jenkins: | 
 | 241 |       client: | 
 | 242 |         source: | 
| Ales Komarek | 5b672fd | 2016-08-29 16:05:03 +0200 | [diff] [blame] | 243 |           base: | 
 | 244 |            engine: git | 
 | 245 |             address: repo_url | 
 | 246 |             branch: branch | 
 | 247 |           domain: | 
 | 248 |            engine: git | 
 | 249 |             address: domain_url | 
 | 250 |             branch: branch | 
| Ales Komarek | daf31f7 | 2016-08-29 11:00:13 +0200 | [diff] [blame] | 251 |         job: | 
 | 252 |           test_workflow_jenkins_simple: | 
 | 253 |             type: workflow | 
 | 254 |             display_name: Test jenkins simple workflow | 
| Ales Komarek | 5b672fd | 2016-08-29 16:05:03 +0200 | [diff] [blame] | 255 |             param: | 
 | 256 |               bool_param: | 
 | 257 |                 type: boolean | 
 | 258 |                 description: true/false | 
 | 259 |                 default: true | 
 | 260 |             script: | 
 | 261 |               repository: base | 
 | 262 |               file: workflows/test_workflow_jenkins_simple.groovy | 
| Ales Komarek | daf31f7 | 2016-08-29 11:00:13 +0200 | [diff] [blame] | 263 |           test_workflow_jenkins_input: | 
 | 264 |             type: workflow | 
 | 265 |             display_name: Test jenkins workflow inputs | 
| Ales Komarek | 5b672fd | 2016-08-29 16:05:03 +0200 | [diff] [blame] | 266 |             script: | 
 | 267 |               repository: domain | 
 | 268 |               file: workflows/test_workflow_jenkins_input.groovy | 
 | 269 |           test_workflow_jenkins_input_jenkinsfile: | 
 | 270 |             type: workflow | 
 | 271 |             display_name: Test jenkins workflow inputs (jenknisfile) | 
 | 272 |             script: | 
 | 273 |               repository: domain | 
 | 274 |               file: workflows/test_workflow_jenkins_input/Jenkinsfile | 
| Ales Komarek | daf31f7 | 2016-08-29 11:00:13 +0200 | [diff] [blame] | 275 |  | 
| Ales Komarek | 5b672fd | 2016-08-29 16:05:03 +0200 | [diff] [blame] | 276 | GIT controlled groovy script with shared libraries | 
 | 277 |  | 
 | 278 | .. code-block:: yaml | 
 | 279 |  | 
 | 280 |     jenkins: | 
 | 281 |       client: | 
 | 282 |         source: | 
 | 283 |           base: | 
 | 284 |            engine: git | 
 | 285 |             address: repo_url | 
 | 286 |             branch: branch | 
 | 287 |           domain: | 
 | 288 |            engine: git | 
 | 289 |             address: domain_url | 
 | 290 |             branch: branch | 
 | 291 |         job: | 
 | 292 |           test_workflow_jenkins_simple: | 
 | 293 |             type: workflow | 
 | 294 |             display_name: Test jenkins simple workflow | 
 | 295 |             param: | 
 | 296 |               bool_param: | 
 | 297 |                 type: boolean | 
 | 298 |                 description: true/false | 
 | 299 |                 default: true | 
 | 300 |             script: | 
 | 301 |               repository: base | 
 | 302 |               file: workflows/test_workflow_jenkins_simple.groovy | 
 | 303 |             libs: | 
 | 304 |             - repository: base | 
 | 305 |               file: macros/cookiecutter.groovy | 
 | 306 |             - repository: base | 
 | 307 |               file: macros/git.groovy | 
| Ales Komarek | daf31f7 | 2016-08-29 11:00:13 +0200 | [diff] [blame] | 308 |  | 
| Jakub Josef | 120714d | 2017-02-09 16:29:18 +0100 | [diff] [blame] | 309 | Setting job max builds to keep (amount of last builds stored on Jenkins master) | 
 | 310 |  | 
 | 311 | .. code-block:: yaml | 
 | 312 |  | 
 | 313 |     jenkins: | 
 | 314 |       client: | 
 | 315 |         job: | 
 | 316 |           my-amazing-job: | 
 | 317 |             type: workflow | 
 | 318 |             discard: | 
 | 319 |               build: | 
 | 320 |                 keep_num: 5 | 
 | 321 |                 keep_days: 5 | 
 | 322 |               artifact: | 
 | 323 |                 keep_num: 6 | 
 | 324 |                 keep_days: 6 | 
 | 325 |  | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 326 |  | 
 | 327 | Using job templates in similar way as in jjb. For now just 1 defined param is | 
 | 328 | supported. | 
 | 329 |  | 
 | 330 | .. code-block:: yaml | 
 | 331 |  | 
 | 332 |     jenkins: | 
 | 333 |       client: | 
 | 334 |         job_template: | 
 | 335 |           test_workflow_template: | 
 | 336 |             name: test-{{formula}}-workflow | 
 | 337 |             template: | 
 | 338 |               type: workflow | 
 | 339 |               display_name: Test jenkins {{name}} workflow | 
 | 340 |               param: | 
 | 341 |                 repo_param: | 
 | 342 |                   type: string | 
 | 343 |                   default: repo/{{formula}} | 
 | 344 |               script: | 
 | 345 |                 repository: base | 
 | 346 |                 file: workflows/test_formula_workflow.groovy | 
 | 347 |             param: | 
 | 348 |               formula: | 
 | 349 |               - aodh | 
 | 350 |               - linux | 
 | 351 |               - openssh | 
 | 352 |  | 
 | 353 | Interpolating parameters for job templates. | 
 | 354 |  | 
 | 355 |     _param: | 
 | 356 |       salt_formulas: | 
 | 357 |       - aodh | 
 | 358 |       - git | 
 | 359 |       - nova | 
 | 360 |       - xorg | 
 | 361 |     jenkins: | 
 | 362 |       client: | 
 | 363 |         job_template: | 
 | 364 |           test_workflow_template: | 
 | 365 |             name: test-{{formula}}-workflow | 
 | 366 |             template: | 
 | 367 |               ... | 
 | 368 |             param: | 
 | 369 |               formula: ${_param:salt_formulas} | 
 | 370 |  | 
 | 371 |  | 
| Jakub Josef | 2a7739b | 2017-01-24 18:33:44 +0100 | [diff] [blame] | 372 | Purging undefined jobs from Jenkins | 
 | 373 |  | 
 | 374 | .. code-block:: yaml | 
 | 375 |  | 
 | 376 |     jenkins: | 
 | 377 |       client: | 
 | 378 |         purge_jobs: true | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 379 |         job: | 
 | 380 |           my-amazing-job: | 
 | 381 |             type: workflow | 
| Jakub Josef | 2a7739b | 2017-01-24 18:33:44 +0100 | [diff] [blame] | 382 |  | 
| Jakub Josef | 10b4e10 | 2017-01-05 18:18:41 +0100 | [diff] [blame] | 383 | Plugins management from client | 
 | 384 |  | 
 | 385 | .. code-block:: yaml | 
 | 386 |  | 
 | 387 |      | 
 | 388 |     jenkins: | 
 | 389 |       client: | 
 | 390 |         plugin: | 
 | 391 |           swarm: | 
 | 392 |             restart: false | 
 | 393 |           hipchat: | 
 | 394 |             enabled: false | 
 | 395 |             restart: true | 
 | 396 |  | 
| Jakub Josef | 063a753 | 2017-01-11 15:48:01 +0100 | [diff] [blame] | 397 | LDAP configuration (depends on LDAP plugin) | 
 | 398 |  | 
 | 399 | .. code-block:: yaml | 
 | 400 |  | 
 | 401 |     jenkins: | 
 | 402 |       client: | 
 | 403 |         security: | 
 | 404 |           ldap: | 
 | 405 |             server: 1.2.3.4 | 
 | 406 |             root_dn: dc=foo,dc=com | 
 | 407 |             user_search_base: cn=users,cn=accounts | 
 | 408 |             manager_dn: "" | 
 | 409 |             manager_password: password | 
 | 410 |             user_search: "" | 
 | 411 |             group_search_base: "" | 
 | 412 |             inhibit_infer_root_dn: false | 
 | 413 |  | 
 | 414 |  | 
 | 415 | Matrix configuration (depends on auth-matrix plugin) | 
 | 416 |  | 
 | 417 | .. code-block:: yaml | 
 | 418 |  | 
 | 419 |     jenkins: | 
 | 420 |       client: | 
 | 421 |         security: | 
 | 422 |           matrix: | 
| Jakub Josef | 0ee470e | 2017-01-17 11:46:58 +0100 | [diff] [blame] | 423 |             # set true for use ProjectMatrixAuthStrategy instead of GlobalMatrixAuthStrategy | 
 | 424 |             project_based: false   | 
| Jakub Josef | 063a753 | 2017-01-11 15:48:01 +0100 | [diff] [blame] | 425 |             permissions: | 
 | 426 |               Jenkins: | 
 | 427 |                 # administrator access | 
 | 428 |                 ADMINISTER: | 
 | 429 |                   - admin | 
 | 430 |                 # read access (anonymous too) | 
 | 431 |                 READ: | 
 | 432 |                   - anonymous | 
 | 433 |                   - user1 | 
 | 434 |                   - user2 | 
 | 435 |                 # agents permissions | 
 | 436 |                 MasterComputer:  | 
 | 437 |                   BUILD:  | 
 | 438 |                     - user3 | 
 | 439 |               # jobs permissions | 
 | 440 |               hudson:  | 
 | 441 |                 model: | 
 | 442 |                   Item: | 
 | 443 |                     BUILD:  | 
 | 444 |                       - user4 | 
 | 445 |  | 
 | 446 | `Common matrix strategies <https://github.com/arbabnazar/configuration/blob/c08a5eaf4e04a68d2481375502a926517097b253/playbooks/roles/tools_jenkins/templates/projectBasedMatrixSecurity.groovy.j2>`_ | 
 | 447 |  | 
| Jakub Josef | 7bb17ab | 2017-01-12 14:52:53 +0100 | [diff] [blame] | 448 | Views enforcing from client | 
 | 449 |  | 
 | 450 | .. code-block:: yaml | 
 | 451 |  | 
 | 452 |     jenkins: | 
 | 453 |       client: | 
 | 454 |         view: | 
 | 455 |          my-list-view: | 
 | 456 |            enabled: true | 
 | 457 |            type: ListView | 
 | 458 |            include_regex: ".\*." | 
 | 459 |          my-view: | 
 | 460 |            # set false to disable | 
 | 461 |            enabled: true | 
 | 462 |            type: MyView | 
 | 463 |  | 
 | 464 | View specific params: | 
 | 465 |  | 
 | 466 | - include_regex for ListView | 
 | 467 |  | 
| Jakub Josef | 063a753 | 2017-01-11 15:48:01 +0100 | [diff] [blame] | 468 |  | 
| Jakub Josef | 123be7a | 2016-12-12 16:02:36 +0100 | [diff] [blame] | 469 | Credentials enforcing from client | 
 | 470 |  | 
 | 471 | .. code-block:: yaml | 
 | 472 |      | 
 | 473 |     jenkins: | 
 | 474 |       client: | 
 | 475 |         credential: | 
 | 476 |           cred_first: | 
 | 477 |             username: admin | 
 | 478 |             password: password | 
 | 479 |           cred_second: | 
 | 480 |             username: salt | 
 | 481 |             password: password | 
 | 482 |           cred_with_key: | 
 | 483 |             username: admin | 
 | 484 |             key: SOMESSHKEY | 
 | 485 |  | 
 | 486 | Users enforcing from client | 
 | 487 |  | 
 | 488 | .. code-block:: yaml | 
 | 489 |  | 
 | 490 |     jenkins: | 
 | 491 |       client: | 
 | 492 |         user: | 
 | 493 |           admin: | 
 | 494 |             password: admin_password | 
 | 495 |             admin: true | 
 | 496 |           user01: | 
 | 497 |             password: user_password | 
 | 498 |  | 
 | 499 | Node enforcing from client using JNLP launcher | 
 | 500 |  | 
 | 501 | .. code-block:: yaml | 
 | 502 |  | 
 | 503 |     jenkins: | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 504 |       client: | 
 | 505 |         node: | 
 | 506 |           node01: | 
 | 507 |             remote_home: /remote/home/path | 
 | 508 |             desc: node-description | 
 | 509 |             num_executors: 1 | 
 | 510 |             node_mode: Normal | 
 | 511 |             ret_strategy: Always | 
 | 512 |             labels: | 
 | 513 |               - example | 
 | 514 |               - label | 
 | 515 |             launcher: | 
 | 516 |                type: jnlp | 
| Jakub Josef | 123be7a | 2016-12-12 16:02:36 +0100 | [diff] [blame] | 517 |  | 
 | 518 | Node enforcing from client using SSH launcher | 
 | 519 |  | 
 | 520 | .. code-block:: yaml | 
 | 521 |  | 
 | 522 |     jenkins: | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 523 |       client: | 
 | 524 |         node: | 
 | 525 |           node01: | 
 | 526 |             remote_home: /remote/home/path | 
 | 527 |             desc: node-description | 
 | 528 |             num_executors: 1 | 
 | 529 |             node_mode: Normal | 
 | 530 |             ret_strategy: Always | 
 | 531 |             labels: | 
 | 532 |               - example | 
 | 533 |               - label  | 
 | 534 |             launcher: | 
 | 535 |                type: ssh | 
 | 536 |                host: test-launcher | 
 | 537 |                port: 22 | 
 | 538 |                username: launcher-user | 
 | 539 |                password: launcher-pass | 
| Jakub Josef | 123be7a | 2016-12-12 16:02:36 +0100 | [diff] [blame] | 540 |  | 
 | 541 | Setting node labels | 
 | 542 |  | 
 | 543 | .. code-block:: yaml | 
 | 544 |  | 
 | 545 |     jenkins: | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 546 |       client: | 
 | 547 |         label: | 
 | 548 |           node-name: | 
 | 549 |             lbl_text: label-offline | 
 | 550 |             append: false # set true for label append instead of replace | 
| Jakub Josef | d8e0429 | 2016-11-28 18:02:27 +0100 | [diff] [blame] | 551 |  | 
| Jakub Josef | 60cc9d2 | 2017-01-18 12:02:14 +0100 | [diff] [blame] | 552 | SMTP server settings from client | 
 | 553 |  | 
 | 554 | .. code-block:: yaml | 
 | 555 |  | 
 | 556 |     jenkins: | 
 | 557 |       client: | 
 | 558 |         smtp: | 
 | 559 |           host: "smtp.domain.com" | 
 | 560 |           username: "user@domain.cz" | 
 | 561 |           password: "smtp-password" | 
 | 562 |           port: 25 | 
 | 563 |           ssl: false | 
 | 564 |           reply_to: reply_to@address.com | 
 | 565 |  | 
| Jakub Josef | a6d4c83 | 2017-01-19 14:06:12 +0100 | [diff] [blame] | 566 | Slack plugin configuration | 
 | 567 |  | 
 | 568 | .. code-block:: yaml | 
 | 569 |      | 
 | 570 |     jenkins: | 
 | 571 |       client: | 
 | 572 |         slack: | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 573 |           team_domain: example.com | 
 | 574 |           token: slack-token | 
 | 575 |           room: slack-room | 
| Jakub Josef | 6e0cda9 | 2017-02-14 18:01:58 +0100 | [diff] [blame] | 576 |           token_credential_id: cred_id | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 577 |           send_as: Some slack user | 
| Jakub Josef | a6d4c83 | 2017-01-19 14:06:12 +0100 | [diff] [blame] | 578 |  | 
| Jakub Josef | 6e0cda9 | 2017-02-14 18:01:58 +0100 | [diff] [blame] | 579 | Pipeline global libraries setup | 
 | 580 |  | 
 | 581 | .. code-block:: yaml | 
 | 582 |  | 
 | 583 |     jenkins: | 
 | 584 |       client: | 
 | 585 |         lib: | 
 | 586 |           my-pipeline-library: | 
 | 587 |             enabled: true | 
 | 588 |             url: https://path-to-my-library | 
 | 589 |             credential_id: github | 
 | 590 |             branch: master # optional, default master | 
 | 591 |             implicit: true # optional default true | 
| Jakub Josef | d8e0429 | 2016-11-28 18:02:27 +0100 | [diff] [blame] | 592 |  | 
| Ales Komarek | 4c0bab1 | 2016-01-22 12:10:50 +0100 | [diff] [blame] | 593 | Usage | 
 | 594 | ===== | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 595 |  | 
| Ales Komarek | 4c0bab1 | 2016-01-22 12:10:50 +0100 | [diff] [blame] | 596 | Generate password hash: | 
 | 597 |  | 
 | 598 | .. code-block:: bash | 
 | 599 |  | 
 | 600 |     echo -n "salt{plainpassword}" | openssl dgst -sha256 | 
 | 601 |  | 
 | 602 | Place in the configuration ``salt:hashpassword``. | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 603 |  | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 604 |  | 
 | 605 | External links | 
 | 606 | ============== | 
| Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 607 |  | 
 | 608 | * https://wiki.jenkins-ci.org/display/JENKINS/Use+Jenkins | 
| Filip Pytloun | adf72fa | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 609 |  | 
| Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 610 |  | 
| Filip Pytloun | adf72fa | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 611 | Documentation and Bugs | 
 | 612 | ====================== | 
 | 613 |  | 
 | 614 | To learn how to install and update salt-formulas, consult the documentation | 
 | 615 | available online at: | 
 | 616 |  | 
 | 617 |     http://salt-formulas.readthedocs.io/ | 
 | 618 |  | 
 | 619 | In the unfortunate event that bugs are discovered, they should be reported to | 
 | 620 | the appropriate issue tracker. Use Github issue tracker for specific salt | 
 | 621 | formula: | 
 | 622 |  | 
 | 623 |     https://github.com/salt-formulas/salt-formula-jenkins/issues | 
 | 624 |  | 
 | 625 | For feature requests, bug reports or blueprints affecting entire ecosystem, | 
 | 626 | use Launchpad salt-formulas project: | 
 | 627 |  | 
 | 628 |     https://launchpad.net/salt-formulas | 
 | 629 |  | 
 | 630 | You can also join salt-formulas-users team and subscribe to mailing list: | 
 | 631 |  | 
 | 632 |     https://launchpad.net/~salt-formulas-users | 
 | 633 |  | 
 | 634 | Developers wishing to work on the salt-formulas projects should always base | 
 | 635 | their work on master branch and submit pull request against specific formula. | 
 | 636 |  | 
 | 637 |     https://github.com/salt-formulas/salt-formula-jenkins | 
 | 638 |  | 
 | 639 | Any questions or feedback is always welcome so feel free to join our IRC | 
 | 640 | channel: | 
 | 641 |  | 
 | 642 |     #salt-formulas @ irc.freenode.net |