blob: 9effd386fb4261c7e9a3cded7fb5cf0f60e9a49d [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
Alexander Evseev1ed23bf2018-08-02 12:12:19 +020074 # Do not manage any xml config files via Salt, use UI instead
75 # Including config.xml and any plugin xml's.
Filip Pytloun52b9c2c2016-01-28 13:45:57 +010076 no_config: true
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +020077 slaves:
78 - name: slave01
79 label: pbuilder
80 executors: 2
81 - name: slave02
82 label: image_builder
83 mode: EXCLUSIVE
84 executors: 2
85 views:
86 - name: "Package builds"
87 regex: "debian-build-.*"
88 - name: "Contrail builds"
89 regex: "contrail-build-.*"
90 - name: "Aptly"
91 regex: "aptly-.*"
92 plugins:
93 - name: slack
94 - name: extended-choice-parameter
95 - name: rebuild
96 - name: test-stability
97
Ales Komarekffe8bb22017-02-09 11:10:16 +010098Jenkins master with experimental plugin source support
Ales Komarekaf967ee2016-08-31 19:38:50 +020099
100.. code-block:: yaml
101
102 jenkins:
103 master:
104 enabled: true
105 update_site_url: 'http://updates.jenkins-ci.org/experimental/update-center.json'
106
Ales Komarekffe8bb22017-02-09 11:10:16 +0100107SMTP server settings
Ales Komarekaf967ee2016-08-31 19:38:50 +0200108
Ales Komarekffe8bb22017-02-09 11:10:16 +0100109.. code-block:: yaml
110
111 jenkins:
112 master:
113 email:
114 engine: "smtp"
115 host: "smtp.domain.com"
116 user: "user@domain.cz"
117 password: "smtp-password"
118 port: 25
119
Jakub Josefbf0b73e2017-03-22 14:32:45 +0100120Script approvals from client
121
122.. code-block:: yaml
123
124 jenkins:
125 client:
126 approved_scripts:
127 - method groovy.json.JsonSlurperClassic parseText java.lang.String
128
129
Ales Komarekffe8bb22017-02-09 11:10:16 +0100130Script approvals
131
132.. code-block:: yaml
133
134 jenkins:
135 master:
136 approved_scripts:
137 - method groovy.json.JsonSlurperClassic parseText java.lang.String
138
139User enforcement
140
141.. code-block:: yaml
142
143 jenkins:
144 master:
145 user:
146 admin:
147 api_token: xxxxxxxxxx
148 password: admin_password
149 email: admin@domain.com
150 user01:
151 api_token: xxxxxxxxxx
152 password: user_password
153 email: user01@domain.com
154
155
156Agent (slave) role
157------------------
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200158
159.. code-block:: yaml
160
Ales Komarek4c0bab12016-01-22 12:10:50 +0100161 jenkins:
162 slave:
163 master:
164 host: jenkins.example.com
165 port: 80
Michael Kutý37a35952016-06-10 23:51:36 +0200166 protocol: http
Ales Komarek4c0bab12016-01-22 12:10:50 +0100167 user:
168 name: jenkins_slave
169 password: dexiech6AepohthaiHook2iesh7ol5ook4Ov3leid3yek6daid2ooNg3Ee2oKeYo
170 gpg:
171 keypair_id: A76882D3
172 public_key: |
173 -----BEGIN PGP PUBLIC KEY BLOCK-----
174 ...
175 private_key: |
176 -----BEGIN PGP PRIVATE KEY BLOCK-----
177 ...
Ales Komarekaf967ee2016-08-31 19:38:50 +0200178
Ales Komarekffe8bb22017-02-09 11:10:16 +0100179
180Client role
181-----------
Ales Komareke5a1ed62016-08-27 12:02:48 +0200182
183Simple client with workflow job definition
184
185.. code-block:: yaml
186
187 jenkins:
188 client:
189 master:
190 host: jenkins.example.com
191 port: 80
192 protocol: http
193 job:
194 jobname:
195 type: workflow
196 param:
197 bool_param:
198 type: boolean
199 description: true/false
200 default: true
201 string_param:
202 type: string
203 description: 1 liner
204 default: default_string
205 text_param:
206 type: text
207 description: multi-liner
208 default: default_text
Filip Pytlounebd4d172016-09-01 14:23:20 +0200209 jobname_scm:
210 type: workflow-scm
211 concurrent: false
212 scm:
213 type: git
214 url: https://github.com/jenkinsci/docker.git
215 branch: master
216 script: Jenkinsfile
217 github:
218 url: https://github.com/jenkinsci/docker
219 name: "Jenkins Docker Image"
220 trigger:
Tomáš Kukrála9cf2c62017-03-04 11:25:20 +0100221 timer:
222 spec: "H H * * *"
Filip Pytlounebd4d172016-09-01 14:23:20 +0200223 github:
224 pollscm:
225 spec: "H/15 * * * *"
226 reverse:
227 projects:
228 - test1
229 - test2
230 state: SUCCESS
231 param:
232 bool_param:
233 type: boolean
234 description: true/false
235 default: true
236 string_param:
237 type: string
238 description: 1 liner
239 default: default_string
240 text_param:
241 type: text
242 description: multi-liner
243 default: default_text
Ales Komareke5a1ed62016-08-27 12:02:48 +0200244
Ales Komarekffe8bb22017-02-09 11:10:16 +0100245Inline Groovy scripts
Ales Komareke5a1ed62016-08-27 12:02:48 +0200246
247.. code-block:: yaml
248
249 jenkins:
250 client:
251 job:
252 test_workflow_jenkins_simple:
253 type: workflow
254 display_name: Test jenkins simple workflow
Ales Komarek5b672fd2016-08-29 16:05:03 +0200255 script:
256 content: |
257 node {
258 stage 'Stage 1'
259 echo 'Hello World 1'
260 stage 'Stage 2'
261 echo 'Hello World 2'
262 }
Ales Komareke5a1ed62016-08-27 12:02:48 +0200263 test_workflow_jenkins_input:
264 type: workflow
265 display_name: Test jenkins workflow inputs
Ales Komarek5b672fd2016-08-29 16:05:03 +0200266 script:
267 content: |
268 node {
269 stage 'Enter string'
270 input message: 'Enter job parameters', ok: 'OK', parameters: [
271 string(defaultValue: 'default', description: 'Enter a string.', name: 'string'),
272 ]
273 stage 'Enter boolean'
274 input message: 'Enter job parameters', ok: 'OK', parameters: [
275 booleanParam(defaultValue: false, description: 'Select boolean.', name: 'Bool'),
276 ]
277 stage 'Enter text'
278 input message: 'Enter job parameters', ok: 'OK', parameters: [
279 text(defaultValue: '', description: 'Enter multiline', name: 'Multiline')
280 ]
281 }
Ales Komareke5a1ed62016-08-27 12:02:48 +0200282
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200283
Ales Komarekffe8bb22017-02-09 11:10:16 +0100284GIT controlled groovy scripts
Ales Komarekdaf31f72016-08-29 11:00:13 +0200285
286.. code-block:: yaml
287
288 jenkins:
289 client:
290 source:
Ales Komarek5b672fd2016-08-29 16:05:03 +0200291 base:
292 engine: git
293 address: repo_url
294 branch: branch
295 domain:
296 engine: git
297 address: domain_url
298 branch: branch
Ales Komarekdaf31f72016-08-29 11:00:13 +0200299 job:
300 test_workflow_jenkins_simple:
301 type: workflow
302 display_name: Test jenkins simple workflow
Ales Komarek5b672fd2016-08-29 16:05:03 +0200303 param:
304 bool_param:
305 type: boolean
306 description: true/false
307 default: true
308 script:
309 repository: base
310 file: workflows/test_workflow_jenkins_simple.groovy
Ales Komarekdaf31f72016-08-29 11:00:13 +0200311 test_workflow_jenkins_input:
312 type: workflow
313 display_name: Test jenkins workflow inputs
Ales Komarek5b672fd2016-08-29 16:05:03 +0200314 script:
315 repository: domain
316 file: workflows/test_workflow_jenkins_input.groovy
317 test_workflow_jenkins_input_jenkinsfile:
318 type: workflow
319 display_name: Test jenkins workflow inputs (jenknisfile)
320 script:
321 repository: domain
322 file: workflows/test_workflow_jenkins_input/Jenkinsfile
Ales Komarekdaf31f72016-08-29 11:00:13 +0200323
Ales Komarek5b672fd2016-08-29 16:05:03 +0200324GIT controlled groovy script with shared libraries
325
326.. code-block:: yaml
327
328 jenkins:
329 client:
330 source:
331 base:
332 engine: git
333 address: repo_url
334 branch: branch
335 domain:
336 engine: git
337 address: domain_url
338 branch: branch
339 job:
340 test_workflow_jenkins_simple:
341 type: workflow
342 display_name: Test jenkins simple workflow
343 param:
344 bool_param:
345 type: boolean
346 description: true/false
347 default: true
348 script:
349 repository: base
350 file: workflows/test_workflow_jenkins_simple.groovy
351 libs:
352 - repository: base
353 file: macros/cookiecutter.groovy
354 - repository: base
355 file: macros/git.groovy
Ales Komarekdaf31f72016-08-29 11:00:13 +0200356
Jakub Josef120714d2017-02-09 16:29:18 +0100357Setting job max builds to keep (amount of last builds stored on Jenkins master)
358
359.. code-block:: yaml
360
361 jenkins:
362 client:
363 job:
364 my-amazing-job:
365 type: workflow
366 discard:
367 build:
368 keep_num: 5
369 keep_days: 5
370 artifact:
371 keep_num: 6
372 keep_days: 6
373
Ales Komarekffe8bb22017-02-09 11:10:16 +0100374
375Using job templates in similar way as in jjb. For now just 1 defined param is
376supported.
377
378.. code-block:: yaml
379
380 jenkins:
381 client:
382 job_template:
383 test_workflow_template:
384 name: test-{{formula}}-workflow
385 template:
386 type: workflow
387 display_name: Test jenkins {{name}} workflow
388 param:
389 repo_param:
390 type: string
391 default: repo/{{formula}}
392 script:
393 repository: base
394 file: workflows/test_formula_workflow.groovy
395 param:
396 formula:
397 - aodh
398 - linux
399 - openssh
400
401Interpolating parameters for job templates.
402
Filip Pytloun83129fc2017-02-23 10:07:32 +0100403.. code-block:: yaml
404
Ales Komarekffe8bb22017-02-09 11:10:16 +0100405 _param:
406 salt_formulas:
407 - aodh
408 - git
409 - nova
410 - xorg
411 jenkins:
412 client:
413 job_template:
414 test_workflow_template:
415 name: test-{{formula}}-workflow
416 template:
417 ...
418 param:
419 formula: ${_param:salt_formulas}
420
Filip Pytloun83129fc2017-02-23 10:07:32 +0100421Or simply define multiple jobs and it's parameters to replace from template:
422
423.. code-block:: yaml
424
425 jenkins:
426 client:
427 job_template:
428 test_workflow_template:
429 name: test-{{name}}-{{myparam}}
430 template:
431 ...
432 jobs:
433 - name: firstjob
434 myparam: dummy
435 - name: secondjob
436 myparam: dummyaswell
Ales Komarekffe8bb22017-02-09 11:10:16 +0100437
Jakub Josef2a7739b2017-01-24 18:33:44 +0100438Purging undefined jobs from Jenkins
439
440.. code-block:: yaml
441
442 jenkins:
443 client:
444 purge_jobs: true
Ales Komarekffe8bb22017-02-09 11:10:16 +0100445 job:
446 my-amazing-job:
447 type: workflow
Jakub Josef2a7739b2017-01-24 18:33:44 +0100448
Jakub Josef10b4e102017-01-05 18:18:41 +0100449Plugins management from client
450
451.. code-block:: yaml
452
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200453
Jakub Josef10b4e102017-01-05 18:18:41 +0100454 jenkins:
455 client:
Alexander Evseevcd836a12018-07-27 13:02:45 +0200456 plugin_remove_unwanted: false
457 plugin_force_remove: false
Jakub Josef10b4e102017-01-05 18:18:41 +0100458 plugin:
Alexander Evseevcd836a12018-07-27 13:02:45 +0200459 plugin1: 1.2.3
460 plugin2:
461 plugin3: {}
462 plugin4:
463 version: 3.2.1
Jakub Josef10b4e102017-01-05 18:18:41 +0100464 enabled: false
Alexander Evseevcd836a12018-07-27 13:02:45 +0200465 plugin5: absent
Jakub Josef10b4e102017-01-05 18:18:41 +0100466
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200467Adding plugin params to job
468
469.. code-block:: yaml
470
471
472 jenkins:
473 client:
474 job:
475 my_plugin_parametrized_job:
476 plugin_properties:
477 throttleconcurrents:
478 enabled: True
479 max_concurrent_per_node: 3
Vasyl Saienko661acf42018-01-18 10:37:07 +0200480 max_concurrent_total: 1
481 throttle_option: category #one of project (default or category)
482 categories:
483 - my_throuttle_category
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200484 plugin:
Alexander Evseevcd836a12018-07-27 13:02:45 +0200485 throttle-concurrents:
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200486
Jakub Josef063a7532017-01-11 15:48:01 +0100487LDAP configuration (depends on LDAP plugin)
488
489.. code-block:: yaml
490
491 jenkins:
492 client:
493 security:
494 ldap:
495 server: 1.2.3.4
496 root_dn: dc=foo,dc=com
497 user_search_base: cn=users,cn=accounts
498 manager_dn: ""
499 manager_password: password
500 user_search: ""
501 group_search_base: ""
502 inhibit_infer_root_dn: false
503
504
505Matrix configuration (depends on auth-matrix plugin)
506
507.. code-block:: yaml
508
509 jenkins:
510 client:
511 security:
512 matrix:
Jakub Josef0ee470e2017-01-17 11:46:58 +0100513 # set true for use ProjectMatrixAuthStrategy instead of GlobalMatrixAuthStrategy
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400514 project_based: false
Jakub Josef063a7532017-01-11 15:48:01 +0100515 permissions:
516 Jenkins:
517 # administrator access
518 ADMINISTER:
519 - admin
520 # read access (anonymous too)
521 READ:
522 - anonymous
523 - user1
524 - user2
525 # agents permissions
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400526 MasterComputer:
527 BUILD:
Jakub Josef063a7532017-01-11 15:48:01 +0100528 - user3
529 # jobs permissions
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400530 hudson:
Jakub Josef063a7532017-01-11 15:48:01 +0100531 model:
532 Item:
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400533 BUILD:
Jakub Josef063a7532017-01-11 15:48:01 +0100534 - user4
535
536`Common matrix strategies <https://github.com/arbabnazar/configuration/blob/c08a5eaf4e04a68d2481375502a926517097b253/playbooks/roles/tools_jenkins/templates/projectBasedMatrixSecurity.groovy.j2>`_
537
Jakub Josef7bb17ab2017-01-12 14:52:53 +0100538Views enforcing from client
539
540.. code-block:: yaml
541
542 jenkins:
543 client:
544 view:
545 my-list-view:
546 enabled: true
547 type: ListView
Jakub Josef7d9fce32017-03-24 16:46:56 +0100548 include_regex: ".*"
Jakub Josef7bb17ab2017-01-12 14:52:53 +0100549 my-view:
550 # set false to disable
551 enabled: true
552 type: MyView
553
554View specific params:
555
Jakub Josef7d9fce32017-03-24 16:46:56 +0100556- include_regex for ListView and CategorizedJobsView
557- categories for CategorizedJobsView
558
559Categorized views
560
561.. code-block:: yaml
562
563 jenkins:
564 client:
565 view:
566 my-categorized-view:
567 enabled: true
568 type: CategorizedJobsView
569 include_regex: ".*"
570 categories:
571 - group_regex: "aptly-.*-nightly-testing"
572 naming_rule: "Nightly -> Testing"
573 - group_regex: "aptly-.*-nightly-production"
574 naming_rule: "Nightly -> Production"
Jakub Josef7bb17ab2017-01-12 14:52:53 +0100575
Jakub Josef063a7532017-01-11 15:48:01 +0100576
Jakub Josef123be7a2016-12-12 16:02:36 +0100577Credentials enforcing from client
578
579.. code-block:: yaml
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200580
Jakub Josef123be7a2016-12-12 16:02:36 +0100581 jenkins:
582 client:
583 credential:
584 cred_first:
585 username: admin
586 password: password
587 cred_second:
588 username: salt
589 password: password
590 cred_with_key:
591 username: admin
592 key: SOMESSHKEY
Sergey Otpuschennikov1dd77992018-06-27 11:11:07 +0400593 cred_with_text_secret:
594 secret: SOMETEXTSECRET
Jakub Josef123be7a2016-12-12 16:02:36 +0100595
596Users enforcing from client
597
598.. code-block:: yaml
599
600 jenkins:
601 client:
602 user:
603 admin:
604 password: admin_password
605 admin: true
606 user01:
607 password: user_password
608
609Node enforcing from client using JNLP launcher
610
611.. code-block:: yaml
612
613 jenkins:
Ales Komarekffe8bb22017-02-09 11:10:16 +0100614 client:
615 node:
616 node01:
617 remote_home: /remote/home/path
618 desc: node-description
619 num_executors: 1
620 node_mode: Normal
621 ret_strategy: Always
622 labels:
623 - example
624 - label
625 launcher:
626 type: jnlp
Jakub Josef123be7a2016-12-12 16:02:36 +0100627
628Node enforcing from client using SSH launcher
629
630.. code-block:: yaml
631
632 jenkins:
Ales Komarekffe8bb22017-02-09 11:10:16 +0100633 client:
634 node:
635 node01:
636 remote_home: /remote/home/path
637 desc: node-description
638 num_executors: 1
639 node_mode: Normal
640 ret_strategy: Always
641 labels:
642 - example
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200643 - label
Ales Komarekffe8bb22017-02-09 11:10:16 +0100644 launcher:
645 type: ssh
646 host: test-launcher
647 port: 22
648 username: launcher-user
649 password: launcher-pass
Jakub Josef123be7a2016-12-12 16:02:36 +0100650
Jakub Josef1bb7f442017-05-26 17:02:56 +0200651Configure Jenkins master
652
653.. code-block:: yaml
654
655 jenkins:
656 client:
657 node:
658 master:
659 num_executors: 1
660 node_mode: Normal # or Exclusive
661 labels:
662 - example
663 - label
664
665
Jakub Josef123be7a2016-12-12 16:02:36 +0100666Setting node labels
667
668.. code-block:: yaml
669
670 jenkins:
Ales Komarekffe8bb22017-02-09 11:10:16 +0100671 client:
672 label:
673 node-name:
674 lbl_text: label-offline
675 append: false # set true for label append instead of replace
Jakub Josefd8e04292016-11-28 18:02:27 +0100676
Jakub Josef60cc9d22017-01-18 12:02:14 +0100677SMTP server settings from client
678
679.. code-block:: yaml
680
681 jenkins:
682 client:
683 smtp:
684 host: "smtp.domain.com"
685 username: "user@domain.cz"
686 password: "smtp-password"
687 port: 25
688 ssl: false
689 reply_to: reply_to@address.com
690
Jakub Josefdfb288c2017-04-27 17:29:00 +0200691Jenkins admin user email enforcement from client
692
693.. code-block:: yaml
694
695 jenkins:
696 client:
697 smtp:
698 admin_email: "My Jenkins <jenkins@myserver.com>"
699
700
Jakub Josefa6d4c832017-01-19 14:06:12 +0100701Slack plugin configuration
702
703.. code-block:: yaml
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400704
Jakub Josefa6d4c832017-01-19 14:06:12 +0100705 jenkins:
706 client:
707 slack:
Ales Komarekffe8bb22017-02-09 11:10:16 +0100708 team_domain: example.com
709 token: slack-token
710 room: slack-room
Jakub Josef6e0cda92017-02-14 18:01:58 +0100711 token_credential_id: cred_id
Ales Komarekffe8bb22017-02-09 11:10:16 +0100712 send_as: Some slack user
Jakub Josefa6d4c832017-01-19 14:06:12 +0100713
Jakub Josef6e0cda92017-02-14 18:01:58 +0100714Pipeline global libraries setup
715
716.. code-block:: yaml
717
718 jenkins:
719 client:
720 lib:
721 my-pipeline-library:
722 enabled: true
723 url: https://path-to-my-library
724 credential_id: github
725 branch: master # optional, default master
726 implicit: true # optional default true
Jakub Josefd8e04292016-11-28 18:02:27 +0100727
Jakub Josef01940252017-05-10 14:01:22 +0200728Artifactory server enforcing
729
730.. code-block:: yaml
731
732 jenkins:
733 client:
734 artifactory:
735 my-artifactory-server:
736 enabled: true
737 url: https://path-to-my-library
738 credential_id: github
739
Dmitry Burmistrova3f2c132018-04-10 16:24:25 +0400740Jenkins Global env properties enforcing
Jakub Josef184ee1c2017-11-29 16:03:09 +0100741
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400742.. code-block:: yaml
Jakub Josef184ee1c2017-11-29 16:03:09 +0100743
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400744 jenkins:
745 client:
746 globalenvprop:
747 OFFLINE_DEPLOYMENT:
748 enabled: true
749 name: "OFFLINE_DEPLOYMENT" # optional, default using dict key
750 value: "true"
Jakub Josef184ee1c2017-11-29 16:03:09 +0100751
Dmitry Burmistrova3f2c132018-04-10 16:24:25 +0400752Throttle categories management from client (requires
753`Throttle Concurrent Builds <https://plugins.jenkins.io/throttle-concurrents>`_
754plugin)
755
756.. code-block:: yaml
757
758 jenkins:
759 client:
760 throttle_category:
761 'My First Category':
762 max_total: 2
763 max_per_node: 1
764 'My Second Category':
765 max_total: 5
766 max_per_node: 2
767 max_per_label:
768 'node_label_1': 1
769 'node_label_2': 2
770 'My Category To Remove:
771 enabled: false
772
Dmitry Burmistrov429b8ec2018-04-25 17:13:48 +0400773Jira sites management from client (requires
774`JIRA <https://plugins.jenkins.io/jira>`_ plugin)
775
776.. code-block:: yaml
777
778 # Remove all sites
779 jenkins:
780 client:
781 jira:
782 enabled: False
783
784.. code-block:: yaml
785
786 jenkins:
787 client:
788 jira:
789 sites:
790 'http://my.jira.site/':
791 link_url: 'http://alternative.link/'
792 http_auth: false
793 use_wiki_notation: false
794 record_scm: false
795 disable_changelog: false
796 issue_pattern: ''
797 any_build_result: false
798 user: 'username'
799 password: 'passwd'
800 conn_timeout: 10
801 visible_for_group: ''
802 visible_for_project: ''
803 timestamps: false
804 timestamp_format: ''
Sergey Otpuschennikov74ea2682018-05-21 16:35:36 +0400805
Sergey Otpuschennikov83996702017-11-23 17:10:57 +0400806Gerrit trigger plugin configuration
807
808.. code-block:: yaml
809
810 jenkins:
811 client:
812 gerrit:
813 server1:
814 host: "gerrit.domain.local"
815 port: 29418
816 username: "jenkins"
817 email: "jenkins@domain.local"
818 auth_key_file: "/var/jenkins_home/.ssh/id_rsa"
819 frontendURL: "https://gerrit.domain.local"
Sergey Otpuschennikov107c1962018-06-20 13:45:04 +0400820 build_current_patches_only: true
821 abort_new_patchsets: false
822 abort_manual_patchsets: false
823 abort_same_topic: false
Sergey Otpuschennikov83996702017-11-23 17:10:57 +0400824 authkey: |
825 SOMESSHKEY
826 server2:
827 host: "gerrit2.domain.local"
828 port: 29418
829 username: "jenkins"
830 email: "jenkins@domain.local"
831 auth_key_file: "/var/jenkins_home/.ssh/id_rsa"
832 frontendURL: "https://gerrit2.domain.local"
Sergey Otpuschennikov107c1962018-06-20 13:45:04 +0400833 build_current_patches_only: true
834 abort_new_patchsets: false
835 abort_manual_patchsets: false
836 abort_same_topic: false
Sergey Otpuschennikov83996702017-11-23 17:10:57 +0400837 authkey: |
838 SOMESSHKEY
Dmitry Burmistrov429b8ec2018-04-25 17:13:48 +0400839
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400840CSRF Protection configuration
841
842.. code-block:: yaml
843
844 jenkins:
845 client:
846 security:
847 csrf:
848 enabled: true
849 proxy_compat: false
850
851
852Agent to Master Access Control
853
854.. code-block:: yaml
855
856 jenkins:
857 client:
858 security:
859 agent2master:
860 enabled: true
861 whitelisted: ''
862 file_path_rules: ''
863
864Content Security Policy configuration
865
866.. code-block:: yaml
867
868 jenkins:
869 client:
870 security:
871 csp: "sandbox; default-src 'none'; img-src 'self'; style-src 'self';"
872
873
Ales Komarek4c0bab12016-01-22 12:10:50 +0100874Usage
875=====
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200876
Ales Komarek4c0bab12016-01-22 12:10:50 +0100877Generate password hash:
878
879.. code-block:: bash
880
881 echo -n "salt{plainpassword}" | openssl dgst -sha256
882
883Place in the configuration ``salt:hashpassword``.
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200884
Ales Komarekffe8bb22017-02-09 11:10:16 +0100885
886External links
887==============
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200888
889* https://wiki.jenkins-ci.org/display/JENKINS/Use+Jenkins
Filip Pytlounadf72fa2017-02-02 13:02:03 +0100890
Ales Komarekffe8bb22017-02-09 11:10:16 +0100891
Filip Pytlounadf72fa2017-02-02 13:02:03 +0100892Documentation and Bugs
893======================
894
895To learn how to install and update salt-formulas, consult the documentation
896available online at:
897
898 http://salt-formulas.readthedocs.io/
899
900In the unfortunate event that bugs are discovered, they should be reported to
901the appropriate issue tracker. Use Github issue tracker for specific salt
902formula:
903
904 https://github.com/salt-formulas/salt-formula-jenkins/issues
905
906For feature requests, bug reports or blueprints affecting entire ecosystem,
907use Launchpad salt-formulas project:
908
909 https://launchpad.net/salt-formulas
910
911You can also join salt-formulas-users team and subscribe to mailing list:
912
913 https://launchpad.net/~salt-formulas-users
914
915Developers wishing to work on the salt-formulas projects should always base
916their work on master branch and submit pull request against specific formula.
917
918 https://github.com/salt-formulas/salt-formula-jenkins
919
920Any questions or feedback is always welcome so feel free to join our IRC
921channel:
922
923 #salt-formulas @ irc.freenode.net