blob: df9f3d952ee417891b66ab9a58e7d041706f19e3 [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
Filip Pytloun52b9c2c2016-01-28 13:45:57 +010073 # Do not manage config.xml from Salt, use UI instead
74 no_config: true
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +020075 slaves:
76 - name: slave01
77 label: pbuilder
78 executors: 2
79 - name: slave02
80 label: image_builder
81 mode: EXCLUSIVE
82 executors: 2
83 views:
84 - name: "Package builds"
85 regex: "debian-build-.*"
86 - name: "Contrail builds"
87 regex: "contrail-build-.*"
88 - name: "Aptly"
89 regex: "aptly-.*"
90 plugins:
91 - name: slack
92 - name: extended-choice-parameter
93 - name: rebuild
94 - name: test-stability
95
Ales Komarekffe8bb22017-02-09 11:10:16 +010096Jenkins master with experimental plugin source support
Ales Komarekaf967ee2016-08-31 19:38:50 +020097
98.. code-block:: yaml
99
100 jenkins:
101 master:
102 enabled: true
103 update_site_url: 'http://updates.jenkins-ci.org/experimental/update-center.json'
104
Ales Komarekffe8bb22017-02-09 11:10:16 +0100105SMTP server settings
Ales Komarekaf967ee2016-08-31 19:38:50 +0200106
Ales Komarekffe8bb22017-02-09 11:10:16 +0100107.. code-block:: yaml
108
109 jenkins:
110 master:
111 email:
112 engine: "smtp"
113 host: "smtp.domain.com"
114 user: "user@domain.cz"
115 password: "smtp-password"
116 port: 25
117
Jakub Josefbf0b73e2017-03-22 14:32:45 +0100118Script approvals from client
119
120.. code-block:: yaml
121
122 jenkins:
123 client:
124 approved_scripts:
125 - method groovy.json.JsonSlurperClassic parseText java.lang.String
126
127
Ales Komarekffe8bb22017-02-09 11:10:16 +0100128Script approvals
129
130.. code-block:: yaml
131
132 jenkins:
133 master:
134 approved_scripts:
135 - method groovy.json.JsonSlurperClassic parseText java.lang.String
136
137User enforcement
138
139.. code-block:: yaml
140
141 jenkins:
142 master:
143 user:
144 admin:
145 api_token: xxxxxxxxxx
146 password: admin_password
147 email: admin@domain.com
148 user01:
149 api_token: xxxxxxxxxx
150 password: user_password
151 email: user01@domain.com
152
153
154Agent (slave) role
155------------------
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200156
157.. code-block:: yaml
158
Ales Komarek4c0bab12016-01-22 12:10:50 +0100159 jenkins:
160 slave:
161 master:
162 host: jenkins.example.com
163 port: 80
Michael Kutý37a35952016-06-10 23:51:36 +0200164 protocol: http
Ales Komarek4c0bab12016-01-22 12:10:50 +0100165 user:
166 name: jenkins_slave
167 password: dexiech6AepohthaiHook2iesh7ol5ook4Ov3leid3yek6daid2ooNg3Ee2oKeYo
168 gpg:
169 keypair_id: A76882D3
170 public_key: |
171 -----BEGIN PGP PUBLIC KEY BLOCK-----
172 ...
173 private_key: |
174 -----BEGIN PGP PRIVATE KEY BLOCK-----
175 ...
Ales Komarekaf967ee2016-08-31 19:38:50 +0200176
Ales Komarekffe8bb22017-02-09 11:10:16 +0100177
178Client role
179-----------
Ales Komareke5a1ed62016-08-27 12:02:48 +0200180
181Simple client with workflow job definition
182
183.. code-block:: yaml
184
185 jenkins:
186 client:
187 master:
188 host: jenkins.example.com
189 port: 80
190 protocol: http
191 job:
192 jobname:
193 type: workflow
194 param:
195 bool_param:
196 type: boolean
197 description: true/false
198 default: true
199 string_param:
200 type: string
201 description: 1 liner
202 default: default_string
203 text_param:
204 type: text
205 description: multi-liner
206 default: default_text
Filip Pytlounebd4d172016-09-01 14:23:20 +0200207 jobname_scm:
208 type: workflow-scm
209 concurrent: false
210 scm:
211 type: git
212 url: https://github.com/jenkinsci/docker.git
213 branch: master
214 script: Jenkinsfile
215 github:
216 url: https://github.com/jenkinsci/docker
217 name: "Jenkins Docker Image"
218 trigger:
Tomáš Kukrála9cf2c62017-03-04 11:25:20 +0100219 timer:
220 spec: "H H * * *"
Filip Pytlounebd4d172016-09-01 14:23:20 +0200221 github:
222 pollscm:
223 spec: "H/15 * * * *"
224 reverse:
225 projects:
226 - test1
227 - test2
228 state: SUCCESS
229 param:
230 bool_param:
231 type: boolean
232 description: true/false
233 default: true
234 string_param:
235 type: string
236 description: 1 liner
237 default: default_string
238 text_param:
239 type: text
240 description: multi-liner
241 default: default_text
Ales Komareke5a1ed62016-08-27 12:02:48 +0200242
Ales Komarekffe8bb22017-02-09 11:10:16 +0100243Inline Groovy scripts
Ales Komareke5a1ed62016-08-27 12:02:48 +0200244
245.. code-block:: yaml
246
247 jenkins:
248 client:
249 job:
250 test_workflow_jenkins_simple:
251 type: workflow
252 display_name: Test jenkins simple workflow
Ales Komarek5b672fd2016-08-29 16:05:03 +0200253 script:
254 content: |
255 node {
256 stage 'Stage 1'
257 echo 'Hello World 1'
258 stage 'Stage 2'
259 echo 'Hello World 2'
260 }
Ales Komareke5a1ed62016-08-27 12:02:48 +0200261 test_workflow_jenkins_input:
262 type: workflow
263 display_name: Test jenkins workflow inputs
Ales Komarek5b672fd2016-08-29 16:05:03 +0200264 script:
265 content: |
266 node {
267 stage 'Enter string'
268 input message: 'Enter job parameters', ok: 'OK', parameters: [
269 string(defaultValue: 'default', description: 'Enter a string.', name: 'string'),
270 ]
271 stage 'Enter boolean'
272 input message: 'Enter job parameters', ok: 'OK', parameters: [
273 booleanParam(defaultValue: false, description: 'Select boolean.', name: 'Bool'),
274 ]
275 stage 'Enter text'
276 input message: 'Enter job parameters', ok: 'OK', parameters: [
277 text(defaultValue: '', description: 'Enter multiline', name: 'Multiline')
278 ]
279 }
Ales Komareke5a1ed62016-08-27 12:02:48 +0200280
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200281
Ales Komarekffe8bb22017-02-09 11:10:16 +0100282GIT controlled groovy scripts
Ales Komarekdaf31f72016-08-29 11:00:13 +0200283
284.. code-block:: yaml
285
286 jenkins:
287 client:
288 source:
Ales Komarek5b672fd2016-08-29 16:05:03 +0200289 base:
290 engine: git
291 address: repo_url
292 branch: branch
293 domain:
294 engine: git
295 address: domain_url
296 branch: branch
Ales Komarekdaf31f72016-08-29 11:00:13 +0200297 job:
298 test_workflow_jenkins_simple:
299 type: workflow
300 display_name: Test jenkins simple workflow
Ales Komarek5b672fd2016-08-29 16:05:03 +0200301 param:
302 bool_param:
303 type: boolean
304 description: true/false
305 default: true
306 script:
307 repository: base
308 file: workflows/test_workflow_jenkins_simple.groovy
Ales Komarekdaf31f72016-08-29 11:00:13 +0200309 test_workflow_jenkins_input:
310 type: workflow
311 display_name: Test jenkins workflow inputs
Ales Komarek5b672fd2016-08-29 16:05:03 +0200312 script:
313 repository: domain
314 file: workflows/test_workflow_jenkins_input.groovy
315 test_workflow_jenkins_input_jenkinsfile:
316 type: workflow
317 display_name: Test jenkins workflow inputs (jenknisfile)
318 script:
319 repository: domain
320 file: workflows/test_workflow_jenkins_input/Jenkinsfile
Ales Komarekdaf31f72016-08-29 11:00:13 +0200321
Ales Komarek5b672fd2016-08-29 16:05:03 +0200322GIT controlled groovy script with shared libraries
323
324.. code-block:: yaml
325
326 jenkins:
327 client:
328 source:
329 base:
330 engine: git
331 address: repo_url
332 branch: branch
333 domain:
334 engine: git
335 address: domain_url
336 branch: branch
337 job:
338 test_workflow_jenkins_simple:
339 type: workflow
340 display_name: Test jenkins simple workflow
341 param:
342 bool_param:
343 type: boolean
344 description: true/false
345 default: true
346 script:
347 repository: base
348 file: workflows/test_workflow_jenkins_simple.groovy
349 libs:
350 - repository: base
351 file: macros/cookiecutter.groovy
352 - repository: base
353 file: macros/git.groovy
Ales Komarekdaf31f72016-08-29 11:00:13 +0200354
Jakub Josef120714d2017-02-09 16:29:18 +0100355Setting job max builds to keep (amount of last builds stored on Jenkins master)
356
357.. code-block:: yaml
358
359 jenkins:
360 client:
361 job:
362 my-amazing-job:
363 type: workflow
364 discard:
365 build:
366 keep_num: 5
367 keep_days: 5
368 artifact:
369 keep_num: 6
370 keep_days: 6
371
Ales Komarekffe8bb22017-02-09 11:10:16 +0100372
373Using job templates in similar way as in jjb. For now just 1 defined param is
374supported.
375
376.. code-block:: yaml
377
378 jenkins:
379 client:
380 job_template:
381 test_workflow_template:
382 name: test-{{formula}}-workflow
383 template:
384 type: workflow
385 display_name: Test jenkins {{name}} workflow
386 param:
387 repo_param:
388 type: string
389 default: repo/{{formula}}
390 script:
391 repository: base
392 file: workflows/test_formula_workflow.groovy
393 param:
394 formula:
395 - aodh
396 - linux
397 - openssh
398
399Interpolating parameters for job templates.
400
Filip Pytloun83129fc2017-02-23 10:07:32 +0100401.. code-block:: yaml
402
Ales Komarekffe8bb22017-02-09 11:10:16 +0100403 _param:
404 salt_formulas:
405 - aodh
406 - git
407 - nova
408 - xorg
409 jenkins:
410 client:
411 job_template:
412 test_workflow_template:
413 name: test-{{formula}}-workflow
414 template:
415 ...
416 param:
417 formula: ${_param:salt_formulas}
418
Filip Pytloun83129fc2017-02-23 10:07:32 +0100419Or simply define multiple jobs and it's parameters to replace from template:
420
421.. code-block:: yaml
422
423 jenkins:
424 client:
425 job_template:
426 test_workflow_template:
427 name: test-{{name}}-{{myparam}}
428 template:
429 ...
430 jobs:
431 - name: firstjob
432 myparam: dummy
433 - name: secondjob
434 myparam: dummyaswell
Ales Komarekffe8bb22017-02-09 11:10:16 +0100435
Jakub Josef2a7739b2017-01-24 18:33:44 +0100436Purging undefined jobs from Jenkins
437
438.. code-block:: yaml
439
440 jenkins:
441 client:
442 purge_jobs: true
Ales Komarekffe8bb22017-02-09 11:10:16 +0100443 job:
444 my-amazing-job:
445 type: workflow
Jakub Josef2a7739b2017-01-24 18:33:44 +0100446
Jakub Josef10b4e102017-01-05 18:18:41 +0100447Plugins management from client
448
449.. code-block:: yaml
450
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200451
Jakub Josef10b4e102017-01-05 18:18:41 +0100452 jenkins:
453 client:
Alexander Evseevcd836a12018-07-27 13:02:45 +0200454 plugin_remove_unwanted: false
455 plugin_force_remove: false
Jakub Josef10b4e102017-01-05 18:18:41 +0100456 plugin:
Alexander Evseevcd836a12018-07-27 13:02:45 +0200457 plugin1: 1.2.3
458 plugin2:
459 plugin3: {}
460 plugin4:
461 version: 3.2.1
Jakub Josef10b4e102017-01-05 18:18:41 +0100462 enabled: false
Alexander Evseevcd836a12018-07-27 13:02:45 +0200463 plugin5: absent
Jakub Josef10b4e102017-01-05 18:18:41 +0100464
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200465Adding plugin params to job
466
467.. code-block:: yaml
468
469
470 jenkins:
471 client:
472 job:
473 my_plugin_parametrized_job:
474 plugin_properties:
475 throttleconcurrents:
476 enabled: True
477 max_concurrent_per_node: 3
Vasyl Saienko661acf42018-01-18 10:37:07 +0200478 max_concurrent_total: 1
479 throttle_option: category #one of project (default or category)
480 categories:
481 - my_throuttle_category
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200482 plugin:
Alexander Evseevcd836a12018-07-27 13:02:45 +0200483 throttle-concurrents:
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200484
Jakub Josef063a7532017-01-11 15:48:01 +0100485LDAP configuration (depends on LDAP plugin)
486
487.. code-block:: yaml
488
489 jenkins:
490 client:
491 security:
492 ldap:
493 server: 1.2.3.4
494 root_dn: dc=foo,dc=com
495 user_search_base: cn=users,cn=accounts
496 manager_dn: ""
497 manager_password: password
498 user_search: ""
499 group_search_base: ""
500 inhibit_infer_root_dn: false
501
502
503Matrix configuration (depends on auth-matrix plugin)
504
505.. code-block:: yaml
506
507 jenkins:
508 client:
509 security:
510 matrix:
Jakub Josef0ee470e2017-01-17 11:46:58 +0100511 # set true for use ProjectMatrixAuthStrategy instead of GlobalMatrixAuthStrategy
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400512 project_based: false
Jakub Josef063a7532017-01-11 15:48:01 +0100513 permissions:
514 Jenkins:
515 # administrator access
516 ADMINISTER:
517 - admin
518 # read access (anonymous too)
519 READ:
520 - anonymous
521 - user1
522 - user2
523 # agents permissions
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400524 MasterComputer:
525 BUILD:
Jakub Josef063a7532017-01-11 15:48:01 +0100526 - user3
527 # jobs permissions
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400528 hudson:
Jakub Josef063a7532017-01-11 15:48:01 +0100529 model:
530 Item:
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400531 BUILD:
Jakub Josef063a7532017-01-11 15:48:01 +0100532 - user4
533
534`Common matrix strategies <https://github.com/arbabnazar/configuration/blob/c08a5eaf4e04a68d2481375502a926517097b253/playbooks/roles/tools_jenkins/templates/projectBasedMatrixSecurity.groovy.j2>`_
535
Jakub Josef7bb17ab2017-01-12 14:52:53 +0100536Views enforcing from client
537
538.. code-block:: yaml
539
540 jenkins:
541 client:
542 view:
543 my-list-view:
544 enabled: true
545 type: ListView
Jakub Josef7d9fce32017-03-24 16:46:56 +0100546 include_regex: ".*"
Jakub Josef7bb17ab2017-01-12 14:52:53 +0100547 my-view:
548 # set false to disable
549 enabled: true
550 type: MyView
551
552View specific params:
553
Jakub Josef7d9fce32017-03-24 16:46:56 +0100554- include_regex for ListView and CategorizedJobsView
555- categories for CategorizedJobsView
556
557Categorized views
558
559.. code-block:: yaml
560
561 jenkins:
562 client:
563 view:
564 my-categorized-view:
565 enabled: true
566 type: CategorizedJobsView
567 include_regex: ".*"
568 categories:
569 - group_regex: "aptly-.*-nightly-testing"
570 naming_rule: "Nightly -> Testing"
571 - group_regex: "aptly-.*-nightly-production"
572 naming_rule: "Nightly -> Production"
Jakub Josef7bb17ab2017-01-12 14:52:53 +0100573
Jakub Josef063a7532017-01-11 15:48:01 +0100574
Jakub Josef123be7a2016-12-12 16:02:36 +0100575Credentials enforcing from client
576
577.. code-block:: yaml
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200578
Jakub Josef123be7a2016-12-12 16:02:36 +0100579 jenkins:
580 client:
581 credential:
582 cred_first:
583 username: admin
584 password: password
585 cred_second:
586 username: salt
587 password: password
588 cred_with_key:
589 username: admin
590 key: SOMESSHKEY
Sergey Otpuschennikov1dd77992018-06-27 11:11:07 +0400591 cred_with_text_secret:
592 secret: SOMETEXTSECRET
Jakub Josef123be7a2016-12-12 16:02:36 +0100593
594Users enforcing from client
595
596.. code-block:: yaml
597
598 jenkins:
599 client:
600 user:
601 admin:
602 password: admin_password
603 admin: true
604 user01:
605 password: user_password
606
607Node enforcing from client using JNLP launcher
608
609.. code-block:: yaml
610
611 jenkins:
Ales Komarekffe8bb22017-02-09 11:10:16 +0100612 client:
613 node:
614 node01:
615 remote_home: /remote/home/path
616 desc: node-description
617 num_executors: 1
618 node_mode: Normal
619 ret_strategy: Always
620 labels:
621 - example
622 - label
623 launcher:
624 type: jnlp
Jakub Josef123be7a2016-12-12 16:02:36 +0100625
626Node enforcing from client using SSH launcher
627
628.. code-block:: yaml
629
630 jenkins:
Ales Komarekffe8bb22017-02-09 11:10:16 +0100631 client:
632 node:
633 node01:
634 remote_home: /remote/home/path
635 desc: node-description
636 num_executors: 1
637 node_mode: Normal
638 ret_strategy: Always
639 labels:
640 - example
Vasyl Saienkocb928a82018-01-17 15:21:28 +0200641 - label
Ales Komarekffe8bb22017-02-09 11:10:16 +0100642 launcher:
643 type: ssh
644 host: test-launcher
645 port: 22
646 username: launcher-user
647 password: launcher-pass
Jakub Josef123be7a2016-12-12 16:02:36 +0100648
Jakub Josef1bb7f442017-05-26 17:02:56 +0200649Configure Jenkins master
650
651.. code-block:: yaml
652
653 jenkins:
654 client:
655 node:
656 master:
657 num_executors: 1
658 node_mode: Normal # or Exclusive
659 labels:
660 - example
661 - label
662
663
Jakub Josef123be7a2016-12-12 16:02:36 +0100664Setting node labels
665
666.. code-block:: yaml
667
668 jenkins:
Ales Komarekffe8bb22017-02-09 11:10:16 +0100669 client:
670 label:
671 node-name:
672 lbl_text: label-offline
673 append: false # set true for label append instead of replace
Jakub Josefd8e04292016-11-28 18:02:27 +0100674
Jakub Josef60cc9d22017-01-18 12:02:14 +0100675SMTP server settings from client
676
677.. code-block:: yaml
678
679 jenkins:
680 client:
681 smtp:
682 host: "smtp.domain.com"
683 username: "user@domain.cz"
684 password: "smtp-password"
685 port: 25
686 ssl: false
687 reply_to: reply_to@address.com
688
Jakub Josefdfb288c2017-04-27 17:29:00 +0200689Jenkins admin user email enforcement from client
690
691.. code-block:: yaml
692
693 jenkins:
694 client:
695 smtp:
696 admin_email: "My Jenkins <jenkins@myserver.com>"
697
698
Jakub Josefa6d4c832017-01-19 14:06:12 +0100699Slack plugin configuration
700
701.. code-block:: yaml
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400702
Jakub Josefa6d4c832017-01-19 14:06:12 +0100703 jenkins:
704 client:
705 slack:
Ales Komarekffe8bb22017-02-09 11:10:16 +0100706 team_domain: example.com
707 token: slack-token
708 room: slack-room
Jakub Josef6e0cda92017-02-14 18:01:58 +0100709 token_credential_id: cred_id
Ales Komarekffe8bb22017-02-09 11:10:16 +0100710 send_as: Some slack user
Jakub Josefa6d4c832017-01-19 14:06:12 +0100711
Jakub Josef6e0cda92017-02-14 18:01:58 +0100712Pipeline global libraries setup
713
714.. code-block:: yaml
715
716 jenkins:
717 client:
718 lib:
719 my-pipeline-library:
720 enabled: true
721 url: https://path-to-my-library
722 credential_id: github
723 branch: master # optional, default master
724 implicit: true # optional default true
Jakub Josefd8e04292016-11-28 18:02:27 +0100725
Jakub Josef01940252017-05-10 14:01:22 +0200726Artifactory server enforcing
727
728.. code-block:: yaml
729
730 jenkins:
731 client:
732 artifactory:
733 my-artifactory-server:
734 enabled: true
735 url: https://path-to-my-library
736 credential_id: github
737
Dmitry Burmistrova3f2c132018-04-10 16:24:25 +0400738Jenkins Global env properties enforcing
Jakub Josef184ee1c2017-11-29 16:03:09 +0100739
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400740.. code-block:: yaml
Jakub Josef184ee1c2017-11-29 16:03:09 +0100741
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400742 jenkins:
743 client:
744 globalenvprop:
745 OFFLINE_DEPLOYMENT:
746 enabled: true
747 name: "OFFLINE_DEPLOYMENT" # optional, default using dict key
748 value: "true"
Jakub Josef184ee1c2017-11-29 16:03:09 +0100749
Dmitry Burmistrova3f2c132018-04-10 16:24:25 +0400750Throttle categories management from client (requires
751`Throttle Concurrent Builds <https://plugins.jenkins.io/throttle-concurrents>`_
752plugin)
753
754.. code-block:: yaml
755
756 jenkins:
757 client:
758 throttle_category:
759 'My First Category':
760 max_total: 2
761 max_per_node: 1
762 'My Second Category':
763 max_total: 5
764 max_per_node: 2
765 max_per_label:
766 'node_label_1': 1
767 'node_label_2': 2
768 'My Category To Remove:
769 enabled: false
770
Dmitry Burmistrov429b8ec2018-04-25 17:13:48 +0400771Jira sites management from client (requires
772`JIRA <https://plugins.jenkins.io/jira>`_ plugin)
773
774.. code-block:: yaml
775
776 # Remove all sites
777 jenkins:
778 client:
779 jira:
780 enabled: False
781
782.. code-block:: yaml
783
784 jenkins:
785 client:
786 jira:
787 sites:
788 'http://my.jira.site/':
789 link_url: 'http://alternative.link/'
790 http_auth: false
791 use_wiki_notation: false
792 record_scm: false
793 disable_changelog: false
794 issue_pattern: ''
795 any_build_result: false
796 user: 'username'
797 password: 'passwd'
798 conn_timeout: 10
799 visible_for_group: ''
800 visible_for_project: ''
801 timestamps: false
802 timestamp_format: ''
Sergey Otpuschennikov74ea2682018-05-21 16:35:36 +0400803
Sergey Otpuschennikov83996702017-11-23 17:10:57 +0400804Gerrit trigger plugin configuration
805
806.. code-block:: yaml
807
808 jenkins:
809 client:
810 gerrit:
811 server1:
812 host: "gerrit.domain.local"
813 port: 29418
814 username: "jenkins"
815 email: "jenkins@domain.local"
816 auth_key_file: "/var/jenkins_home/.ssh/id_rsa"
817 frontendURL: "https://gerrit.domain.local"
Sergey Otpuschennikov107c1962018-06-20 13:45:04 +0400818 build_current_patches_only: true
819 abort_new_patchsets: false
820 abort_manual_patchsets: false
821 abort_same_topic: false
Sergey Otpuschennikov83996702017-11-23 17:10:57 +0400822 authkey: |
823 SOMESSHKEY
824 server2:
825 host: "gerrit2.domain.local"
826 port: 29418
827 username: "jenkins"
828 email: "jenkins@domain.local"
829 auth_key_file: "/var/jenkins_home/.ssh/id_rsa"
830 frontendURL: "https://gerrit2.domain.local"
Sergey Otpuschennikov107c1962018-06-20 13:45:04 +0400831 build_current_patches_only: true
832 abort_new_patchsets: false
833 abort_manual_patchsets: false
834 abort_same_topic: false
Sergey Otpuschennikov83996702017-11-23 17:10:57 +0400835 authkey: |
836 SOMESSHKEY
Dmitry Burmistrov429b8ec2018-04-25 17:13:48 +0400837
Dmitry Burmistrov2953edf2018-05-24 11:32:54 +0400838CSRF Protection configuration
839
840.. code-block:: yaml
841
842 jenkins:
843 client:
844 security:
845 csrf:
846 enabled: true
847 proxy_compat: false
848
849
850Agent to Master Access Control
851
852.. code-block:: yaml
853
854 jenkins:
855 client:
856 security:
857 agent2master:
858 enabled: true
859 whitelisted: ''
860 file_path_rules: ''
861
862Content Security Policy configuration
863
864.. code-block:: yaml
865
866 jenkins:
867 client:
868 security:
869 csp: "sandbox; default-src 'none'; img-src 'self'; style-src 'self';"
870
871
Ales Komarek4c0bab12016-01-22 12:10:50 +0100872Usage
873=====
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200874
Ales Komarek4c0bab12016-01-22 12:10:50 +0100875Generate password hash:
876
877.. code-block:: bash
878
879 echo -n "salt{plainpassword}" | openssl dgst -sha256
880
881Place in the configuration ``salt:hashpassword``.
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200882
Ales Komarekffe8bb22017-02-09 11:10:16 +0100883
884External links
885==============
Filip Pytloun8bfd2bf2015-10-06 16:28:32 +0200886
887* https://wiki.jenkins-ci.org/display/JENKINS/Use+Jenkins
Filip Pytlounadf72fa2017-02-02 13:02:03 +0100888
Ales Komarekffe8bb22017-02-09 11:10:16 +0100889
Filip Pytlounadf72fa2017-02-02 13:02:03 +0100890Documentation and Bugs
891======================
892
893To learn how to install and update salt-formulas, consult the documentation
894available online at:
895
896 http://salt-formulas.readthedocs.io/
897
898In the unfortunate event that bugs are discovered, they should be reported to
899the appropriate issue tracker. Use Github issue tracker for specific salt
900formula:
901
902 https://github.com/salt-formulas/salt-formula-jenkins/issues
903
904For feature requests, bug reports or blueprints affecting entire ecosystem,
905use Launchpad salt-formulas project:
906
907 https://launchpad.net/salt-formulas
908
909You can also join salt-formulas-users team and subscribe to mailing list:
910
911 https://launchpad.net/~salt-formulas-users
912
913Developers wishing to work on the salt-formulas projects should always base
914their work on master branch and submit pull request against specific formula.
915
916 https://github.com/salt-formulas/salt-formula-jenkins
917
918Any questions or feedback is always welcome so feel free to join our IRC
919channel:
920
921 #salt-formulas @ irc.freenode.net