blob: 09d860bae3ac61ca5e05e68bef2e4d9543d2faa5 [file] [log] [blame]
Ales Komarekffe8bb22017-02-09 11:10:16 +01001===============
2Jenkins formula
3===============
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +02004
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +04005Jenkins CI is an open source automation server written in Java. Jenkins
6helps to automate the non-human part of software development process, with
Dan Alvizu5d9336b2018-01-15 14:43:51 -07007continuous integration and facilitating technical aspects of continuous delivery.
8
9(*Source*: `Wikipedia <https://en.wikipedia.org/wiki/Jenkins_(software)>`_ )
10
11More information can be found at `<https://jenkins.io/>`_
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +020012
Ales Komarekffe8bb22017-02-09 11:10:16 +010013Setup jenkins client, works with Salt 2016.3+, supports pipeline workflow
14projects only now.
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +020015
Dan Alvizu5d9336b2018-01-15 14:43:51 -070016Dependencies
17==============
18
19To install on Ubuntu, you will need to add the jenkins debian repository to the target
20server. You can do this with the `salt-formula-linux formula <https://github.com/salt-formulas/salt-formula-linux>`_ ,
21with the following pillar data:
22
23.. code-block:: yaml
24
25 linux:
26 system:
27 enabled: true
28 repo:
29 jenkins:
30 enabled: true
31 source: "deb http://pkg.jenkins.io/debian-stable binary/"
32 key_url: "https://pkg.jenkins.io/debian/jenkins-ci.org.key"
33
34This state will need to be applied *before* the jenkins state.
35
36Using this formula
37==================
38
39To use this formula, you must install the formula to your salt master as documented
40in `saltstack formula docs <https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#installation>`_
41
42This formula is driven by pillar data, and can be used to install either a Jenkins Master
43or Client. See pillar data below for examples.
44
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +020045
Ales Komareke5a1ed62016-08-27 12:02:48 +020046Sample pillars
47==============
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +020048
Ales Komarekffe8bb22017-02-09 11:10:16 +010049Master role
50-----------
Ales Komareke5a1ed62016-08-27 12:02:48 +020051
52Simple master with reverse proxy
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +020053
54.. code-block:: yaml
55
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +020056 nginx:
57 server:
58 site:
59 jenkins:
60 enabled: true
61 type: nginx_proxy
62 name: jenkins
63 proxy:
64 host: 127.0.0.1
65 port: 8080
66 protocol: http
67 host:
68 name: jenkins.example.com
69 port: 80
70 jenkins:
71 master:
72 mode: EXCLUSIVE
Alexander Evseev2c494d72018-08-01 11:52:18 +020073 java_args: -Xms256m -Xmx1g
Filip Pytloun52b9c2c2016-01-28 13:45:57 +010074 # Do not manage config.xml from Salt, use UI instead
75 no_config: true
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +020076 slaves:
77 - name: slave01
78 label: pbuilder
79 executors: 2
80 - name: slave02
81 label: image_builder
82 mode: EXCLUSIVE
83 executors: 2
84 views:
85 - name: "Package builds"
86 regex: "debian-build-.*"
87 - name: "Contrail builds"
88 regex: "contrail-build-.*"
89 - name: "Aptly"
90 regex: "aptly-.*"
91 plugins:
92 - name: slack
93 - name: extended-choice-parameter
94 - name: rebuild
95 - name: test-stability
96
Ales Komarekffe8bb22017-02-09 11:10:16 +010097Jenkins master with experimental plugin source support
Ales Komarekaf967ee2016-08-31 19:38:50 +020098
99.. code-block:: yaml
100
101 jenkins:
102 master:
103 enabled: true
104 update_site_url: 'http://updates.jenkins-ci.org/experimental/update-center.json'
105
Ales Komarekffe8bb22017-02-09 11:10:16 +0100106SMTP server settings
Ales Komarekaf967ee2016-08-31 19:38:50 +0200107
Ales Komarekffe8bb22017-02-09 11:10:16 +0100108.. code-block:: yaml
109
110 jenkins:
111 master:
112 email:
113 engine: "smtp"
114 host: "smtp.domain.com"
115 user: "user@domain.cz"
116 password: "smtp-password"
117 port: 25
118
Jakub Josefbf0b73e2017-03-22 14:32:45 +0100119Script approvals from client
120
121.. code-block:: yaml
122
123 jenkins:
124 client:
125 approved_scripts:
126 - method groovy.json.JsonSlurperClassic parseText java.lang.String
127
128
Ales Komarekffe8bb22017-02-09 11:10:16 +0100129Script approvals
130
131.. code-block:: yaml
132
133 jenkins:
134 master:
135 approved_scripts:
136 - method groovy.json.JsonSlurperClassic parseText java.lang.String
137
138User enforcement
139
140.. code-block:: yaml
141
142 jenkins:
143 master:
144 user:
145 admin:
146 api_token: xxxxxxxxxx
147 password: admin_password
148 email: admin@domain.com
149 user01:
150 api_token: xxxxxxxxxx
151 password: user_password
152 email: user01@domain.com
153
154
155Agent (slave) role
156------------------
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200157
158.. code-block:: yaml
159
Ales Komarek4c0bab12016-01-22 12:10:50 +0100160 jenkins:
161 slave:
162 master:
163 host: jenkins.example.com
164 port: 80
Michael Kutý37a35952016-06-10 23:51:36 +0200165 protocol: http
Ales Komarek4c0bab12016-01-22 12:10:50 +0100166 user:
167 name: jenkins_slave
168 password: dexiech6AepohthaiHook2iesh7ol5ook4Ov3leid3yek6daid2ooNg3Ee2oKeYo
169 gpg:
170 keypair_id: A76882D3
171 public_key: |
172 -----BEGIN PGP PUBLIC KEY BLOCK-----
173 ...
174 private_key: |
175 -----BEGIN PGP PRIVATE KEY BLOCK-----
176 ...
Ales Komarekaf967ee2016-08-31 19:38:50 +0200177
Ales Komarekffe8bb22017-02-09 11:10:16 +0100178
179Client role
180-----------
Ales Komareke5a1ed62016-08-27 12:02:48 +0200181
182Simple client with workflow job definition
183
184.. code-block:: yaml
185
186 jenkins:
187 client:
188 master:
189 host: jenkins.example.com
190 port: 80
191 protocol: http
192 job:
193 jobname:
194 type: workflow
195 param:
196 bool_param:
197 type: boolean
198 description: true/false
199 default: true
200 string_param:
201 type: string
202 description: 1 liner
203 default: default_string
204 text_param:
205 type: text
206 description: multi-liner
207 default: default_text
Filip Pytlounebd4d172016-09-01 14:23:20 +0200208 jobname_scm:
209 type: workflow-scm
210 concurrent: false
211 scm:
212 type: git
213 url: https://github.com/jenkinsci/docker.git
214 branch: master
215 script: Jenkinsfile
216 github:
217 url: https://github.com/jenkinsci/docker
218 name: "Jenkins Docker Image"
219 trigger:
Tomáš Kukrála9cf2c62017-03-04 11:25:20 +0100220 timer:
221 spec: "H H * * *"
Filip Pytlounebd4d172016-09-01 14:23:20 +0200222 github:
223 pollscm:
224 spec: "H/15 * * * *"
225 reverse:
226 projects:
227 - test1
228 - test2
229 state: SUCCESS
230 param:
231 bool_param:
232 type: boolean
233 description: true/false
234 default: true
235 string_param:
236 type: string
237 description: 1 liner
238 default: default_string
239 text_param:
240 type: text
241 description: multi-liner
242 default: default_text
Ales Komareke5a1ed62016-08-27 12:02:48 +0200243
Ales Komarekffe8bb22017-02-09 11:10:16 +0100244Inline Groovy scripts
Ales Komareke5a1ed62016-08-27 12:02:48 +0200245
246.. code-block:: yaml
247
248 jenkins:
249 client:
250 job:
251 test_workflow_jenkins_simple:
252 type: workflow
253 display_name: Test jenkins simple workflow
Ales Komarek5b672fd2016-08-29 16:05:03 +0200254 script:
255 content: |
256 node {
257 stage 'Stage 1'
258 echo 'Hello World 1'
259 stage 'Stage 2'
260 echo 'Hello World 2'
261 }
Ales Komareke5a1ed62016-08-27 12:02:48 +0200262 test_workflow_jenkins_input:
263 type: workflow
264 display_name: Test jenkins workflow inputs
Ales Komarek5b672fd2016-08-29 16:05:03 +0200265 script:
266 content: |
267 node {
268 stage 'Enter string'
269 input message: 'Enter job parameters', ok: 'OK', parameters: [
270 string(defaultValue: 'default', description: 'Enter a string.', name: 'string'),
271 ]
272 stage 'Enter boolean'
273 input message: 'Enter job parameters', ok: 'OK', parameters: [
274 booleanParam(defaultValue: false, description: 'Select boolean.', name: 'Bool'),
275 ]
276 stage 'Enter text'
277 input message: 'Enter job parameters', ok: 'OK', parameters: [
278 text(defaultValue: '', description: 'Enter multiline', name: 'Multiline')
279 ]
280 }
Ales Komareke5a1ed62016-08-27 12:02:48 +0200281
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200282
Ales Komarekffe8bb22017-02-09 11:10:16 +0100283GIT controlled groovy scripts
Ales Komarekdaf31f72016-08-29 11:00:13 +0200284
285.. code-block:: yaml
286
287 jenkins:
288 client:
289 source:
Ales Komarek5b672fd2016-08-29 16:05:03 +0200290 base:
291 engine: git
292 address: repo_url
293 branch: branch
294 domain:
295 engine: git
296 address: domain_url
297 branch: branch
Ales Komarekdaf31f72016-08-29 11:00:13 +0200298 job:
299 test_workflow_jenkins_simple:
300 type: workflow
301 display_name: Test jenkins simple workflow
Ales Komarek5b672fd2016-08-29 16:05:03 +0200302 param:
303 bool_param:
304 type: boolean
305 description: true/false
306 default: true
307 script:
308 repository: base
309 file: workflows/test_workflow_jenkins_simple.groovy
Ales Komarekdaf31f72016-08-29 11:00:13 +0200310 test_workflow_jenkins_input:
311 type: workflow
312 display_name: Test jenkins workflow inputs
Ales Komarek5b672fd2016-08-29 16:05:03 +0200313 script:
314 repository: domain
315 file: workflows/test_workflow_jenkins_input.groovy
316 test_workflow_jenkins_input_jenkinsfile:
317 type: workflow
318 display_name: Test jenkins workflow inputs (jenknisfile)
319 script:
320 repository: domain
321 file: workflows/test_workflow_jenkins_input/Jenkinsfile
Ales Komarekdaf31f72016-08-29 11:00:13 +0200322
Ales Komarek5b672fd2016-08-29 16:05:03 +0200323GIT controlled groovy script with shared libraries
324
325.. code-block:: yaml
326
327 jenkins:
328 client:
329 source:
330 base:
331 engine: git
332 address: repo_url
333 branch: branch
334 domain:
335 engine: git
336 address: domain_url
337 branch: branch
338 job:
339 test_workflow_jenkins_simple:
340 type: workflow
341 display_name: Test jenkins simple workflow
342 param:
343 bool_param:
344 type: boolean
345 description: true/false
346 default: true
347 script:
348 repository: base
349 file: workflows/test_workflow_jenkins_simple.groovy
350 libs:
351 - repository: base
352 file: macros/cookiecutter.groovy
353 - repository: base
354 file: macros/git.groovy
Ales Komarekdaf31f72016-08-29 11:00:13 +0200355
Jakub Josef120714d2017-02-09 16:29:18 +0100356Setting job max builds to keep (amount of last builds stored on Jenkins master)
357
358.. code-block:: yaml
359
360 jenkins:
361 client:
362 job:
363 my-amazing-job:
364 type: workflow
365 discard:
366 build:
367 keep_num: 5
368 keep_days: 5
369 artifact:
370 keep_num: 6
371 keep_days: 6
372
Ales Komarekffe8bb22017-02-09 11:10:16 +0100373
374Using job templates in similar way as in jjb. For now just 1 defined param is
375supported.
376
377.. code-block:: yaml
378
379 jenkins:
380 client:
381 job_template:
382 test_workflow_template:
383 name: test-{{formula}}-workflow
384 template:
385 type: workflow
386 display_name: Test jenkins {{name}} workflow
387 param:
388 repo_param:
389 type: string
390 default: repo/{{formula}}
391 script:
392 repository: base
393 file: workflows/test_formula_workflow.groovy
394 param:
395 formula:
396 - aodh
397 - linux
398 - openssh
399
400Interpolating parameters for job templates.
401
Filip Pytloun83129fc2017-02-23 10:07:32 +0100402.. code-block:: yaml
403
Ales Komarekffe8bb22017-02-09 11:10:16 +0100404 _param:
405 salt_formulas:
406 - aodh
407 - git
408 - nova
409 - xorg
410 jenkins:
411 client:
412 job_template:
413 test_workflow_template:
414 name: test-{{formula}}-workflow
415 template:
416 ...
417 param:
418 formula: ${_param:salt_formulas}
419
Filip Pytloun83129fc2017-02-23 10:07:32 +0100420Or simply define multiple jobs and it's parameters to replace from template:
421
422.. code-block:: yaml
423
424 jenkins:
425 client:
426 job_template:
427 test_workflow_template:
428 name: test-{{name}}-{{myparam}}
429 template:
430 ...
431 jobs:
432 - name: firstjob
433 myparam: dummy
434 - name: secondjob
435 myparam: dummyaswell
Ales Komarekffe8bb22017-02-09 11:10:16 +0100436
Jakub Josef2a7739b2017-01-24 18:33:44 +0100437Purging undefined jobs from Jenkins
438
439.. code-block:: yaml
440
441 jenkins:
442 client:
443 purge_jobs: true
Ales Komarekffe8bb22017-02-09 11:10:16 +0100444 job:
445 my-amazing-job:
446 type: workflow
Jakub Josef2a7739b2017-01-24 18:33:44 +0100447
Jakub Josef10b4e102017-01-05 18:18:41 +0100448Plugins management from client
449
450.. code-block:: yaml
451
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200452
Jakub Josef10b4e102017-01-05 18:18:41 +0100453 jenkins:
454 client:
Alexander Evseevcd836a12018-07-27 13:02:45 +0200455 plugin_remove_unwanted: false
456 plugin_force_remove: false
Jakub Josef10b4e102017-01-05 18:18:41 +0100457 plugin:
Alexander Evseevcd836a12018-07-27 13:02:45 +0200458 plugin1: 1.2.3
459 plugin2:
460 plugin3: {}
461 plugin4:
462 version: 3.2.1
Jakub Josef10b4e102017-01-05 18:18:41 +0100463 enabled: false
Alexander Evseevcd836a12018-07-27 13:02:45 +0200464 plugin5: absent
Jakub Josef10b4e102017-01-05 18:18:41 +0100465
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200466Adding plugin params to job
467
468.. code-block:: yaml
469
470
471 jenkins:
472 client:
473 job:
474 my_plugin_parametrized_job:
475 plugin_properties:
476 throttleconcurrents:
477 enabled: True
478 max_concurrent_per_node: 3
Vasyl Saienko661acf42018-01-18 10:37:07 +0200479 max_concurrent_total: 1
480 throttle_option: category #one of project (default or category)
481 categories:
482 - my_throuttle_category
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200483 plugin:
Alexander Evseevcd836a12018-07-27 13:02:45 +0200484 throttle-concurrents:
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200485
Jakub Josef063a7532017-01-11 15:48:01 +0100486LDAP configuration (depends on LDAP plugin)
487
488.. code-block:: yaml
489
490 jenkins:
491 client:
492 security:
493 ldap:
494 server: 1.2.3.4
495 root_dn: dc=foo,dc=com
496 user_search_base: cn=users,cn=accounts
497 manager_dn: ""
498 manager_password: password
499 user_search: ""
500 group_search_base: ""
501 inhibit_infer_root_dn: false
502
503
504Matrix configuration (depends on auth-matrix plugin)
505
506.. code-block:: yaml
507
508 jenkins:
509 client:
510 security:
511 matrix:
Jakub Josef0ee470e2017-01-17 11:46:58 +0100512 # set true for use ProjectMatrixAuthStrategy instead of GlobalMatrixAuthStrategy
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400513 project_based: false
Jakub Josef063a7532017-01-11 15:48:01 +0100514 permissions:
515 Jenkins:
516 # administrator access
517 ADMINISTER:
518 - admin
519 # read access (anonymous too)
520 READ:
521 - anonymous
522 - user1
523 - user2
524 # agents permissions
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400525 MasterComputer:
526 BUILD:
Jakub Josef063a7532017-01-11 15:48:01 +0100527 - user3
528 # jobs permissions
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400529 hudson:
Jakub Josef063a7532017-01-11 15:48:01 +0100530 model:
531 Item:
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400532 BUILD:
Jakub Josef063a7532017-01-11 15:48:01 +0100533 - user4
534
535`Common matrix strategies <https://github.com/arbabnazar/configuration/blob/c08a5eaf4e04a68d2481375502a926517097b253/playbooks/roles/tools_jenkins/templates/projectBasedMatrixSecurity.groovy.j2>`_
536
Jakub Josef7bb17ab2017-01-12 14:52:53 +0100537Views enforcing from client
538
539.. code-block:: yaml
540
541 jenkins:
542 client:
543 view:
544 my-list-view:
545 enabled: true
546 type: ListView
Jakub Josef7d9fce32017-03-24 16:46:56 +0100547 include_regex: ".*"
Jakub Josef7bb17ab2017-01-12 14:52:53 +0100548 my-view:
549 # set false to disable
550 enabled: true
551 type: MyView
552
553View specific params:
554
Jakub Josef7d9fce32017-03-24 16:46:56 +0100555- include_regex for ListView and CategorizedJobsView
556- categories for CategorizedJobsView
557
558Categorized views
559
560.. code-block:: yaml
561
562 jenkins:
563 client:
564 view:
565 my-categorized-view:
566 enabled: true
567 type: CategorizedJobsView
568 include_regex: ".*"
569 categories:
570 - group_regex: "aptly-.*-nightly-testing"
571 naming_rule: "Nightly -> Testing"
572 - group_regex: "aptly-.*-nightly-production"
573 naming_rule: "Nightly -> Production"
Jakub Josef7bb17ab2017-01-12 14:52:53 +0100574
Jakub Josef063a7532017-01-11 15:48:01 +0100575
Jakub Josef123be7a2016-12-12 16:02:36 +0100576Credentials enforcing from client
577
578.. code-block:: yaml
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200579
Jakub Josef123be7a2016-12-12 16:02:36 +0100580 jenkins:
581 client:
582 credential:
583 cred_first:
584 username: admin
585 password: password
586 cred_second:
587 username: salt
588 password: password
589 cred_with_key:
590 username: admin
591 key: SOMESSHKEY
Sergey Otpuschennikov1dd77992018-06-27 11:11:07 +0400592 cred_with_text_secret:
593 secret: SOMETEXTSECRET
Jakub Josef123be7a2016-12-12 16:02:36 +0100594
595Users enforcing from client
596
597.. code-block:: yaml
598
599 jenkins:
600 client:
601 user:
602 admin:
603 password: admin_password
604 admin: true
605 user01:
606 password: user_password
607
608Node enforcing from client using JNLP launcher
609
610.. code-block:: yaml
611
612 jenkins:
Ales Komarekffe8bb22017-02-09 11:10:16 +0100613 client:
614 node:
615 node01:
616 remote_home: /remote/home/path
617 desc: node-description
618 num_executors: 1
619 node_mode: Normal
620 ret_strategy: Always
621 labels:
622 - example
623 - label
624 launcher:
625 type: jnlp
Jakub Josef123be7a2016-12-12 16:02:36 +0100626
627Node enforcing from client using SSH launcher
628
629.. code-block:: yaml
630
631 jenkins:
Ales Komarekffe8bb22017-02-09 11:10:16 +0100632 client:
633 node:
634 node01:
635 remote_home: /remote/home/path
636 desc: node-description
637 num_executors: 1
638 node_mode: Normal
639 ret_strategy: Always
640 labels:
641 - example
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200642 - label
Ales Komarekffe8bb22017-02-09 11:10:16 +0100643 launcher:
644 type: ssh
645 host: test-launcher
646 port: 22
647 username: launcher-user
648 password: launcher-pass
Jakub Josef123be7a2016-12-12 16:02:36 +0100649
Jakub Josef1bb7f442017-05-26 17:02:56 +0200650Configure Jenkins master
651
652.. code-block:: yaml
653
654 jenkins:
655 client:
656 node:
657 master:
658 num_executors: 1
659 node_mode: Normal # or Exclusive
660 labels:
661 - example
662 - label
663
664
Jakub Josef123be7a2016-12-12 16:02:36 +0100665Setting node labels
666
667.. code-block:: yaml
668
669 jenkins:
Ales Komarekffe8bb22017-02-09 11:10:16 +0100670 client:
671 label:
672 node-name:
673 lbl_text: label-offline
674 append: false # set true for label append instead of replace
Jakub Josefd8e04292016-11-28 18:02:27 +0100675
Jakub Josef60cc9d22017-01-18 12:02:14 +0100676SMTP server settings from client
677
678.. code-block:: yaml
679
680 jenkins:
681 client:
682 smtp:
683 host: "smtp.domain.com"
684 username: "user@domain.cz"
685 password: "smtp-password"
686 port: 25
687 ssl: false
688 reply_to: reply_to@address.com
689
Jakub Josefdfb288c2017-04-27 17:29:00 +0200690Jenkins admin user email enforcement from client
691
692.. code-block:: yaml
693
694 jenkins:
695 client:
696 smtp:
697 admin_email: "My Jenkins <jenkins@myserver.com>"
698
699
Jakub Josefa6d4c832017-01-19 14:06:12 +0100700Slack plugin configuration
701
702.. code-block:: yaml
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400703
Jakub Josefa6d4c832017-01-19 14:06:12 +0100704 jenkins:
705 client:
706 slack:
Ales Komarekffe8bb22017-02-09 11:10:16 +0100707 team_domain: example.com
708 token: slack-token
709 room: slack-room
Jakub Josef6e0cda92017-02-14 18:01:58 +0100710 token_credential_id: cred_id
Ales Komarekffe8bb22017-02-09 11:10:16 +0100711 send_as: Some slack user
Jakub Josefa6d4c832017-01-19 14:06:12 +0100712
Jakub Josef6e0cda92017-02-14 18:01:58 +0100713Pipeline global libraries setup
714
715.. code-block:: yaml
716
717 jenkins:
718 client:
719 lib:
720 my-pipeline-library:
721 enabled: true
722 url: https://path-to-my-library
723 credential_id: github
724 branch: master # optional, default master
725 implicit: true # optional default true
Jakub Josefd8e04292016-11-28 18:02:27 +0100726
Jakub Josef01940252017-05-10 14:01:22 +0200727Artifactory server enforcing
728
729.. code-block:: yaml
730
731 jenkins:
732 client:
733 artifactory:
734 my-artifactory-server:
735 enabled: true
736 url: https://path-to-my-library
737 credential_id: github
738
Dmitry Burmistrova3f2c132018-04-10 16:24:25 +0400739Jenkins Global env properties enforcing
Jakub Josef184ee1c2017-11-29 16:03:09 +0100740
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400741.. code-block:: yaml
Jakub Josef184ee1c2017-11-29 16:03:09 +0100742
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400743 jenkins:
744 client:
745 globalenvprop:
746 OFFLINE_DEPLOYMENT:
747 enabled: true
748 name: "OFFLINE_DEPLOYMENT" # optional, default using dict key
749 value: "true"
Jakub Josef184ee1c2017-11-29 16:03:09 +0100750
Dmitry Burmistrova3f2c132018-04-10 16:24:25 +0400751Throttle categories management from client (requires
752`Throttle Concurrent Builds <https://plugins.jenkins.io/throttle-concurrents>`_
753plugin)
754
755.. code-block:: yaml
756
757 jenkins:
758 client:
759 throttle_category:
760 'My First Category':
761 max_total: 2
762 max_per_node: 1
763 'My Second Category':
764 max_total: 5
765 max_per_node: 2
766 max_per_label:
767 'node_label_1': 1
768 'node_label_2': 2
769 'My Category To Remove:
770 enabled: false
771
Dmitry Burmistrov429b8ec2018-04-25 17:13:48 +0400772Jira sites management from client (requires
773`JIRA <https://plugins.jenkins.io/jira>`_ plugin)
774
775.. code-block:: yaml
776
777 # Remove all sites
778 jenkins:
779 client:
780 jira:
781 enabled: False
782
783.. code-block:: yaml
784
785 jenkins:
786 client:
787 jira:
788 sites:
789 'http://my.jira.site/':
790 link_url: 'http://alternative.link/'
791 http_auth: false
792 use_wiki_notation: false
793 record_scm: false
794 disable_changelog: false
795 issue_pattern: ''
796 any_build_result: false
797 user: 'username'
798 password: 'passwd'
799 conn_timeout: 10
800 visible_for_group: ''
801 visible_for_project: ''
802 timestamps: false
803 timestamp_format: ''
Sergey Otpuschennikov74ea2682018-05-21 16:35:36 +0400804
Sergey Otpuschennikov83996702017-11-23 17:10:57 +0400805Gerrit trigger plugin configuration
806
807.. code-block:: yaml
808
809 jenkins:
810 client:
811 gerrit:
812 server1:
813 host: "gerrit.domain.local"
814 port: 29418
815 username: "jenkins"
816 email: "jenkins@domain.local"
817 auth_key_file: "/var/jenkins_home/.ssh/id_rsa"
818 frontendURL: "https://gerrit.domain.local"
Sergey Otpuschennikov107c1962018-06-20 13:45:04 +0400819 build_current_patches_only: true
820 abort_new_patchsets: false
821 abort_manual_patchsets: false
822 abort_same_topic: false
Sergey Otpuschennikov83996702017-11-23 17:10:57 +0400823 authkey: |
824 SOMESSHKEY
825 server2:
826 host: "gerrit2.domain.local"
827 port: 29418
828 username: "jenkins"
829 email: "jenkins@domain.local"
830 auth_key_file: "/var/jenkins_home/.ssh/id_rsa"
831 frontendURL: "https://gerrit2.domain.local"
Sergey Otpuschennikov107c1962018-06-20 13:45:04 +0400832 build_current_patches_only: true
833 abort_new_patchsets: false
834 abort_manual_patchsets: false
835 abort_same_topic: false
Sergey Otpuschennikov83996702017-11-23 17:10:57 +0400836 authkey: |
837 SOMESSHKEY
Dmitry Burmistrov429b8ec2018-04-25 17:13:48 +0400838
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400839CSRF Protection configuration
840
841.. code-block:: yaml
842
843 jenkins:
844 client:
845 security:
846 csrf:
847 enabled: true
848 proxy_compat: false
849
850
851Agent to Master Access Control
852
853.. code-block:: yaml
854
855 jenkins:
856 client:
857 security:
858 agent2master:
859 enabled: true
860 whitelisted: ''
861 file_path_rules: ''
862
863Content Security Policy configuration
864
865.. code-block:: yaml
866
867 jenkins:
868 client:
869 security:
870 csp: "sandbox; default-src 'none'; img-src 'self'; style-src 'self';"
871
872
Ales Komarek4c0bab12016-01-22 12:10:50 +0100873Usage
874=====
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200875
Ales Komarek4c0bab12016-01-22 12:10:50 +0100876Generate password hash:
877
878.. code-block:: bash
879
880 echo -n "salt{plainpassword}" | openssl dgst -sha256
881
882Place in the configuration ``salt:hashpassword``.
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200883
Ales Komarekffe8bb22017-02-09 11:10:16 +0100884
885External links
886==============
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200887
888* https://wiki.jenkins-ci.org/display/JENKINS/Use+Jenkins
Filip Pytlounadf72fa2017-02-02 13:02:03 +0100889
Ales Komarekffe8bb22017-02-09 11:10:16 +0100890
Filip Pytlounadf72fa2017-02-02 13:02:03 +0100891Documentation and Bugs
892======================
893
894To learn how to install and update salt-formulas, consult the documentation
895available online at:
896
897 http://salt-formulas.readthedocs.io/
898
899In the unfortunate event that bugs are discovered, they should be reported to
900the appropriate issue tracker. Use Github issue tracker for specific salt
901formula:
902
903 https://github.com/salt-formulas/salt-formula-jenkins/issues
904
905For feature requests, bug reports or blueprints affecting entire ecosystem,
906use Launchpad salt-formulas project:
907
908 https://launchpad.net/salt-formulas
909
910You can also join salt-formulas-users team and subscribe to mailing list:
911
912 https://launchpad.net/~salt-formulas-users
913
914Developers wishing to work on the salt-formulas projects should always base
915their work on master branch and submit pull request against specific formula.
916
917 https://github.com/salt-formulas/salt-formula-jenkins
918
919Any questions or feedback is always welcome so feel free to join our IRC
920channel:
921
922 #salt-formulas @ irc.freenode.net