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: |
Tomáš Kukrál | a9cf2c6 | 2017-03-04 11:25:20 +0100 | [diff] [blame^] | 175 | timer: |
| 176 | spec: "H H * * *" |
Filip Pytloun | ebd4d17 | 2016-09-01 14:23:20 +0200 | [diff] [blame] | 177 | github: |
| 178 | pollscm: |
| 179 | spec: "H/15 * * * *" |
| 180 | reverse: |
| 181 | projects: |
| 182 | - test1 |
| 183 | - test2 |
| 184 | state: SUCCESS |
| 185 | param: |
| 186 | bool_param: |
| 187 | type: boolean |
| 188 | description: true/false |
| 189 | default: true |
| 190 | string_param: |
| 191 | type: string |
| 192 | description: 1 liner |
| 193 | default: default_string |
| 194 | text_param: |
| 195 | type: text |
| 196 | description: multi-liner |
| 197 | default: default_text |
Ales Komarek | e5a1ed6 | 2016-08-27 12:02:48 +0200 | [diff] [blame] | 198 | |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 199 | Inline Groovy scripts |
Ales Komarek | e5a1ed6 | 2016-08-27 12:02:48 +0200 | [diff] [blame] | 200 | |
| 201 | .. code-block:: yaml |
| 202 | |
| 203 | jenkins: |
| 204 | client: |
| 205 | job: |
| 206 | test_workflow_jenkins_simple: |
| 207 | type: workflow |
| 208 | display_name: Test jenkins simple workflow |
Ales Komarek | 5b672fd | 2016-08-29 16:05:03 +0200 | [diff] [blame] | 209 | script: |
| 210 | content: | |
| 211 | node { |
| 212 | stage 'Stage 1' |
| 213 | echo 'Hello World 1' |
| 214 | stage 'Stage 2' |
| 215 | echo 'Hello World 2' |
| 216 | } |
Ales Komarek | e5a1ed6 | 2016-08-27 12:02:48 +0200 | [diff] [blame] | 217 | test_workflow_jenkins_input: |
| 218 | type: workflow |
| 219 | display_name: Test jenkins workflow inputs |
Ales Komarek | 5b672fd | 2016-08-29 16:05:03 +0200 | [diff] [blame] | 220 | script: |
| 221 | content: | |
| 222 | node { |
| 223 | stage 'Enter string' |
| 224 | input message: 'Enter job parameters', ok: 'OK', parameters: [ |
| 225 | string(defaultValue: 'default', description: 'Enter a string.', name: 'string'), |
| 226 | ] |
| 227 | stage 'Enter boolean' |
| 228 | input message: 'Enter job parameters', ok: 'OK', parameters: [ |
| 229 | booleanParam(defaultValue: false, description: 'Select boolean.', name: 'Bool'), |
| 230 | ] |
| 231 | stage 'Enter text' |
| 232 | input message: 'Enter job parameters', ok: 'OK', parameters: [ |
| 233 | text(defaultValue: '', description: 'Enter multiline', name: 'Multiline') |
| 234 | ] |
| 235 | } |
Ales Komarek | e5a1ed6 | 2016-08-27 12:02:48 +0200 | [diff] [blame] | 236 | |
Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 237 | |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 238 | GIT controlled groovy scripts |
Ales Komarek | daf31f7 | 2016-08-29 11:00:13 +0200 | [diff] [blame] | 239 | |
| 240 | .. code-block:: yaml |
| 241 | |
| 242 | jenkins: |
| 243 | client: |
| 244 | source: |
Ales Komarek | 5b672fd | 2016-08-29 16:05:03 +0200 | [diff] [blame] | 245 | base: |
| 246 | engine: git |
| 247 | address: repo_url |
| 248 | branch: branch |
| 249 | domain: |
| 250 | engine: git |
| 251 | address: domain_url |
| 252 | branch: branch |
Ales Komarek | daf31f7 | 2016-08-29 11:00:13 +0200 | [diff] [blame] | 253 | job: |
| 254 | test_workflow_jenkins_simple: |
| 255 | type: workflow |
| 256 | display_name: Test jenkins simple workflow |
Ales Komarek | 5b672fd | 2016-08-29 16:05:03 +0200 | [diff] [blame] | 257 | param: |
| 258 | bool_param: |
| 259 | type: boolean |
| 260 | description: true/false |
| 261 | default: true |
| 262 | script: |
| 263 | repository: base |
| 264 | file: workflows/test_workflow_jenkins_simple.groovy |
Ales Komarek | daf31f7 | 2016-08-29 11:00:13 +0200 | [diff] [blame] | 265 | test_workflow_jenkins_input: |
| 266 | type: workflow |
| 267 | display_name: Test jenkins workflow inputs |
Ales Komarek | 5b672fd | 2016-08-29 16:05:03 +0200 | [diff] [blame] | 268 | script: |
| 269 | repository: domain |
| 270 | file: workflows/test_workflow_jenkins_input.groovy |
| 271 | test_workflow_jenkins_input_jenkinsfile: |
| 272 | type: workflow |
| 273 | display_name: Test jenkins workflow inputs (jenknisfile) |
| 274 | script: |
| 275 | repository: domain |
| 276 | file: workflows/test_workflow_jenkins_input/Jenkinsfile |
Ales Komarek | daf31f7 | 2016-08-29 11:00:13 +0200 | [diff] [blame] | 277 | |
Ales Komarek | 5b672fd | 2016-08-29 16:05:03 +0200 | [diff] [blame] | 278 | GIT controlled groovy script with shared libraries |
| 279 | |
| 280 | .. code-block:: yaml |
| 281 | |
| 282 | jenkins: |
| 283 | client: |
| 284 | source: |
| 285 | base: |
| 286 | engine: git |
| 287 | address: repo_url |
| 288 | branch: branch |
| 289 | domain: |
| 290 | engine: git |
| 291 | address: domain_url |
| 292 | branch: branch |
| 293 | job: |
| 294 | test_workflow_jenkins_simple: |
| 295 | type: workflow |
| 296 | display_name: Test jenkins simple workflow |
| 297 | param: |
| 298 | bool_param: |
| 299 | type: boolean |
| 300 | description: true/false |
| 301 | default: true |
| 302 | script: |
| 303 | repository: base |
| 304 | file: workflows/test_workflow_jenkins_simple.groovy |
| 305 | libs: |
| 306 | - repository: base |
| 307 | file: macros/cookiecutter.groovy |
| 308 | - repository: base |
| 309 | file: macros/git.groovy |
Ales Komarek | daf31f7 | 2016-08-29 11:00:13 +0200 | [diff] [blame] | 310 | |
Jakub Josef | 120714d | 2017-02-09 16:29:18 +0100 | [diff] [blame] | 311 | Setting job max builds to keep (amount of last builds stored on Jenkins master) |
| 312 | |
| 313 | .. code-block:: yaml |
| 314 | |
| 315 | jenkins: |
| 316 | client: |
| 317 | job: |
| 318 | my-amazing-job: |
| 319 | type: workflow |
| 320 | discard: |
| 321 | build: |
| 322 | keep_num: 5 |
| 323 | keep_days: 5 |
| 324 | artifact: |
| 325 | keep_num: 6 |
| 326 | keep_days: 6 |
| 327 | |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 328 | |
| 329 | Using job templates in similar way as in jjb. For now just 1 defined param is |
| 330 | supported. |
| 331 | |
| 332 | .. code-block:: yaml |
| 333 | |
| 334 | jenkins: |
| 335 | client: |
| 336 | job_template: |
| 337 | test_workflow_template: |
| 338 | name: test-{{formula}}-workflow |
| 339 | template: |
| 340 | type: workflow |
| 341 | display_name: Test jenkins {{name}} workflow |
| 342 | param: |
| 343 | repo_param: |
| 344 | type: string |
| 345 | default: repo/{{formula}} |
| 346 | script: |
| 347 | repository: base |
| 348 | file: workflows/test_formula_workflow.groovy |
| 349 | param: |
| 350 | formula: |
| 351 | - aodh |
| 352 | - linux |
| 353 | - openssh |
| 354 | |
| 355 | Interpolating parameters for job templates. |
| 356 | |
Filip Pytloun | 83129fc | 2017-02-23 10:07:32 +0100 | [diff] [blame] | 357 | .. code-block:: yaml |
| 358 | |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 359 | _param: |
| 360 | salt_formulas: |
| 361 | - aodh |
| 362 | - git |
| 363 | - nova |
| 364 | - xorg |
| 365 | jenkins: |
| 366 | client: |
| 367 | job_template: |
| 368 | test_workflow_template: |
| 369 | name: test-{{formula}}-workflow |
| 370 | template: |
| 371 | ... |
| 372 | param: |
| 373 | formula: ${_param:salt_formulas} |
| 374 | |
Filip Pytloun | 83129fc | 2017-02-23 10:07:32 +0100 | [diff] [blame] | 375 | Or simply define multiple jobs and it's parameters to replace from template: |
| 376 | |
| 377 | .. code-block:: yaml |
| 378 | |
| 379 | jenkins: |
| 380 | client: |
| 381 | job_template: |
| 382 | test_workflow_template: |
| 383 | name: test-{{name}}-{{myparam}} |
| 384 | template: |
| 385 | ... |
| 386 | jobs: |
| 387 | - name: firstjob |
| 388 | myparam: dummy |
| 389 | - name: secondjob |
| 390 | myparam: dummyaswell |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 391 | |
Jakub Josef | 2a7739b | 2017-01-24 18:33:44 +0100 | [diff] [blame] | 392 | Purging undefined jobs from Jenkins |
| 393 | |
| 394 | .. code-block:: yaml |
| 395 | |
| 396 | jenkins: |
| 397 | client: |
| 398 | purge_jobs: true |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 399 | job: |
| 400 | my-amazing-job: |
| 401 | type: workflow |
Jakub Josef | 2a7739b | 2017-01-24 18:33:44 +0100 | [diff] [blame] | 402 | |
Jakub Josef | 10b4e10 | 2017-01-05 18:18:41 +0100 | [diff] [blame] | 403 | Plugins management from client |
| 404 | |
| 405 | .. code-block:: yaml |
| 406 | |
| 407 | |
| 408 | jenkins: |
| 409 | client: |
| 410 | plugin: |
| 411 | swarm: |
| 412 | restart: false |
| 413 | hipchat: |
| 414 | enabled: false |
| 415 | restart: true |
| 416 | |
Jakub Josef | 063a753 | 2017-01-11 15:48:01 +0100 | [diff] [blame] | 417 | LDAP configuration (depends on LDAP plugin) |
| 418 | |
| 419 | .. code-block:: yaml |
| 420 | |
| 421 | jenkins: |
| 422 | client: |
| 423 | security: |
| 424 | ldap: |
| 425 | server: 1.2.3.4 |
| 426 | root_dn: dc=foo,dc=com |
| 427 | user_search_base: cn=users,cn=accounts |
| 428 | manager_dn: "" |
| 429 | manager_password: password |
| 430 | user_search: "" |
| 431 | group_search_base: "" |
| 432 | inhibit_infer_root_dn: false |
| 433 | |
| 434 | |
| 435 | Matrix configuration (depends on auth-matrix plugin) |
| 436 | |
| 437 | .. code-block:: yaml |
| 438 | |
| 439 | jenkins: |
| 440 | client: |
| 441 | security: |
| 442 | matrix: |
Jakub Josef | 0ee470e | 2017-01-17 11:46:58 +0100 | [diff] [blame] | 443 | # set true for use ProjectMatrixAuthStrategy instead of GlobalMatrixAuthStrategy |
| 444 | project_based: false |
Jakub Josef | 063a753 | 2017-01-11 15:48:01 +0100 | [diff] [blame] | 445 | permissions: |
| 446 | Jenkins: |
| 447 | # administrator access |
| 448 | ADMINISTER: |
| 449 | - admin |
| 450 | # read access (anonymous too) |
| 451 | READ: |
| 452 | - anonymous |
| 453 | - user1 |
| 454 | - user2 |
| 455 | # agents permissions |
| 456 | MasterComputer: |
| 457 | BUILD: |
| 458 | - user3 |
| 459 | # jobs permissions |
| 460 | hudson: |
| 461 | model: |
| 462 | Item: |
| 463 | BUILD: |
| 464 | - user4 |
| 465 | |
| 466 | `Common matrix strategies <https://github.com/arbabnazar/configuration/blob/c08a5eaf4e04a68d2481375502a926517097b253/playbooks/roles/tools_jenkins/templates/projectBasedMatrixSecurity.groovy.j2>`_ |
| 467 | |
Jakub Josef | 7bb17ab | 2017-01-12 14:52:53 +0100 | [diff] [blame] | 468 | Views enforcing from client |
| 469 | |
| 470 | .. code-block:: yaml |
| 471 | |
| 472 | jenkins: |
| 473 | client: |
| 474 | view: |
| 475 | my-list-view: |
| 476 | enabled: true |
| 477 | type: ListView |
| 478 | include_regex: ".\*." |
| 479 | my-view: |
| 480 | # set false to disable |
| 481 | enabled: true |
| 482 | type: MyView |
| 483 | |
| 484 | View specific params: |
| 485 | |
| 486 | - include_regex for ListView |
| 487 | |
Jakub Josef | 063a753 | 2017-01-11 15:48:01 +0100 | [diff] [blame] | 488 | |
Jakub Josef | 123be7a | 2016-12-12 16:02:36 +0100 | [diff] [blame] | 489 | Credentials enforcing from client |
| 490 | |
| 491 | .. code-block:: yaml |
| 492 | |
| 493 | jenkins: |
| 494 | client: |
| 495 | credential: |
| 496 | cred_first: |
| 497 | username: admin |
| 498 | password: password |
| 499 | cred_second: |
| 500 | username: salt |
| 501 | password: password |
| 502 | cred_with_key: |
| 503 | username: admin |
| 504 | key: SOMESSHKEY |
| 505 | |
| 506 | Users enforcing from client |
| 507 | |
| 508 | .. code-block:: yaml |
| 509 | |
| 510 | jenkins: |
| 511 | client: |
| 512 | user: |
| 513 | admin: |
| 514 | password: admin_password |
| 515 | admin: true |
| 516 | user01: |
| 517 | password: user_password |
| 518 | |
| 519 | Node enforcing from client using JNLP launcher |
| 520 | |
| 521 | .. code-block:: yaml |
| 522 | |
| 523 | jenkins: |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 524 | client: |
| 525 | node: |
| 526 | node01: |
| 527 | remote_home: /remote/home/path |
| 528 | desc: node-description |
| 529 | num_executors: 1 |
| 530 | node_mode: Normal |
| 531 | ret_strategy: Always |
| 532 | labels: |
| 533 | - example |
| 534 | - label |
| 535 | launcher: |
| 536 | type: jnlp |
Jakub Josef | 123be7a | 2016-12-12 16:02:36 +0100 | [diff] [blame] | 537 | |
| 538 | Node enforcing from client using SSH launcher |
| 539 | |
| 540 | .. code-block:: yaml |
| 541 | |
| 542 | jenkins: |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 543 | client: |
| 544 | node: |
| 545 | node01: |
| 546 | remote_home: /remote/home/path |
| 547 | desc: node-description |
| 548 | num_executors: 1 |
| 549 | node_mode: Normal |
| 550 | ret_strategy: Always |
| 551 | labels: |
| 552 | - example |
| 553 | - label |
| 554 | launcher: |
| 555 | type: ssh |
| 556 | host: test-launcher |
| 557 | port: 22 |
| 558 | username: launcher-user |
| 559 | password: launcher-pass |
Jakub Josef | 123be7a | 2016-12-12 16:02:36 +0100 | [diff] [blame] | 560 | |
| 561 | Setting node labels |
| 562 | |
| 563 | .. code-block:: yaml |
| 564 | |
| 565 | jenkins: |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 566 | client: |
| 567 | label: |
| 568 | node-name: |
| 569 | lbl_text: label-offline |
| 570 | append: false # set true for label append instead of replace |
Jakub Josef | d8e0429 | 2016-11-28 18:02:27 +0100 | [diff] [blame] | 571 | |
Jakub Josef | 60cc9d2 | 2017-01-18 12:02:14 +0100 | [diff] [blame] | 572 | SMTP server settings from client |
| 573 | |
| 574 | .. code-block:: yaml |
| 575 | |
| 576 | jenkins: |
| 577 | client: |
| 578 | smtp: |
| 579 | host: "smtp.domain.com" |
| 580 | username: "user@domain.cz" |
| 581 | password: "smtp-password" |
| 582 | port: 25 |
| 583 | ssl: false |
| 584 | reply_to: reply_to@address.com |
| 585 | |
Jakub Josef | a6d4c83 | 2017-01-19 14:06:12 +0100 | [diff] [blame] | 586 | Slack plugin configuration |
| 587 | |
| 588 | .. code-block:: yaml |
| 589 | |
| 590 | jenkins: |
| 591 | client: |
| 592 | slack: |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 593 | team_domain: example.com |
| 594 | token: slack-token |
| 595 | room: slack-room |
Jakub Josef | 6e0cda9 | 2017-02-14 18:01:58 +0100 | [diff] [blame] | 596 | token_credential_id: cred_id |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 597 | send_as: Some slack user |
Jakub Josef | a6d4c83 | 2017-01-19 14:06:12 +0100 | [diff] [blame] | 598 | |
Jakub Josef | 6e0cda9 | 2017-02-14 18:01:58 +0100 | [diff] [blame] | 599 | Pipeline global libraries setup |
| 600 | |
| 601 | .. code-block:: yaml |
| 602 | |
| 603 | jenkins: |
| 604 | client: |
| 605 | lib: |
| 606 | my-pipeline-library: |
| 607 | enabled: true |
| 608 | url: https://path-to-my-library |
| 609 | credential_id: github |
| 610 | branch: master # optional, default master |
| 611 | implicit: true # optional default true |
Jakub Josef | d8e0429 | 2016-11-28 18:02:27 +0100 | [diff] [blame] | 612 | |
Ales Komarek | 4c0bab1 | 2016-01-22 12:10:50 +0100 | [diff] [blame] | 613 | Usage |
| 614 | ===== |
Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 615 | |
Ales Komarek | 4c0bab1 | 2016-01-22 12:10:50 +0100 | [diff] [blame] | 616 | Generate password hash: |
| 617 | |
| 618 | .. code-block:: bash |
| 619 | |
| 620 | echo -n "salt{plainpassword}" | openssl dgst -sha256 |
| 621 | |
| 622 | Place in the configuration ``salt:hashpassword``. |
Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 623 | |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 624 | |
| 625 | External links |
| 626 | ============== |
Filip Pytloun | 8bfd2bf | 2015-10-06 16:28:32 +0200 | [diff] [blame] | 627 | |
| 628 | * https://wiki.jenkins-ci.org/display/JENKINS/Use+Jenkins |
Filip Pytloun | adf72fa | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 629 | |
Ales Komarek | ffe8bb2 | 2017-02-09 11:10:16 +0100 | [diff] [blame] | 630 | |
Filip Pytloun | adf72fa | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 631 | Documentation and Bugs |
| 632 | ====================== |
| 633 | |
| 634 | To learn how to install and update salt-formulas, consult the documentation |
| 635 | available online at: |
| 636 | |
| 637 | http://salt-formulas.readthedocs.io/ |
| 638 | |
| 639 | In the unfortunate event that bugs are discovered, they should be reported to |
| 640 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 641 | formula: |
| 642 | |
| 643 | https://github.com/salt-formulas/salt-formula-jenkins/issues |
| 644 | |
| 645 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 646 | use Launchpad salt-formulas project: |
| 647 | |
| 648 | https://launchpad.net/salt-formulas |
| 649 | |
| 650 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 651 | |
| 652 | https://launchpad.net/~salt-formulas-users |
| 653 | |
| 654 | Developers wishing to work on the salt-formulas projects should always base |
| 655 | their work on master branch and submit pull request against specific formula. |
| 656 | |
| 657 | https://github.com/salt-formulas/salt-formula-jenkins |
| 658 | |
| 659 | Any questions or feedback is always welcome so feel free to join our IRC |
| 660 | channel: |
| 661 | |
| 662 | #salt-formulas @ irc.freenode.net |