blob: 9494238e897859f5b97f920bfb188fcf51b2c7d5 [file] [log] [blame]
Ales Komarek3446a0a2016-03-08 10:21:00 +01001
OlgaGusarenkocb981942018-07-30 17:26:31 +03002=====
3Usage
4=====
Ales Komarek3446a0a2016-03-08 10:21:00 +01005
OlgaGusarenkocb981942018-07-30 17:26:31 +03006Gerrit provides web based code review and repository management for the Git
7version control system.
Ales Komarek3446a0a2016-03-08 10:21:00 +01008
9Sample pillars
10==============
11
Ales Komarek49a37292016-08-31 16:18:31 +020012Simple gerrit service
Ales Komarek3446a0a2016-03-08 10:21:00 +010013
14.. code-block:: yaml
15
16 gerrit:
17 server:
18 enabled: true
Ales Komarek7f93ce22016-08-29 23:27:47 +020019 source:
20 engine: http
21 address: https://gerrit-ci.gerritforge.com/job/Gerrit-stable-2.13/20/artifact/buck-out/gen/gerrit.war
22 hash: 2e17064b8742c4622815593ec496c571
Ales Komarek3446a0a2016-03-08 10:21:00 +010023
Ales Komarek49a37292016-08-31 16:18:31 +020024Full service setup
25
26.. code-block:: yaml
27
28 gerrit:
29 server:
Martin Polreich5ec9e542018-07-17 13:54:55 +020030 enabled: true
Ales Komarek49a37292016-08-31 16:18:31 +020031 canonical_web_url: http://10.10.10.148:8082/
32 email_private_key: ""
33 token_private_key: ""
34 initial_user:
35 full_name: John Doe
36 email: 'mail@jdoe.com'
37 username: jdoe
38 plugin:
39 download-commands:
40 engine: gerrit
41 # replication:
42 # engine: gerrit
43 reviewnotes:
44 engine: gerrit
45 singleusergroup:
46 engine: gerrit
47 ssh_rsa_key: |
48 -----BEGIN RSA PRIVATE KEY-----
49 MIIEowIBAAKCAQEAs0Y8mxS3dfs5zG8Du5vdBkfOCOng1IEUmFZIirJ8oBgJOd54
50 QgmkDFB7oP9eTCgz9k/rix1uJWhhVCMBzrWzH5IODO+tyy/tK66pv2BWtVfTDhBA
51 nShOLDNbSIBaV8E/NcrbnQN+b0alp4N7rQnavkOYl+JQncKjz1csmCodirscB9Oj
52 rdo6NG9olv9IQd/tDQxEeDyQkoW50aCEWcq7o+QaTzgnlrL+XZEzhzjdcvA9m8go
53 ...
54 jvMXms60iD/A5OpG33LWHNNzQBP486SxG75LB+Xs5sp5j2/b7VF5LJLhpGiJv9Mk
55 ydbuy8iuuvali2uF133kAlLqnrWfVTYQQI1OfW5glOv1L6kv94dU
56 -----END RSA PRIVATE KEY-----
57 ssh_rsa_key_pub: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzRjybFLd1+znMbwO7m90GR84I6eDUgRSYVkiKsnygGAk53nhCCaQMUHug/15MKDP2T+uLHW4laGFUIwHOtbMfkg4M763LL+0rrqm/YFa1V9MOEECdKE4sM1tIgFpXwT81ytudA35vRqWng3utCdq+Q5iX4lCdwqPPVyyYKh2KuxwH06Ot2jo0b2iW/0hB3+0NDER4PJCShbnRoIRZyruj5BpPOCeWsv5dkTOHON1y8D2byCgNGdCBIRx7x9Qb4dKK2F01r0/bfBGxELJzBdQ8XO14bQ7VOd3gTxrccTM4tVS7/uc/vtjiq7MKjnHGf/svbw9bTHAXbXcWXtOlRe51
58 email: mail@domain.com
59 auth:
60 engine: HTTP
61 source:
62 engine: http
63 address: https://gerrit-releases.storage.googleapis.com/gerrit-2.12.4.war
64 hash: sha256=45786a920a929c6258de6461bcf03ddec8925577bd485905f102ceb6e5e1e47c
Jakub Josef09765e12018-01-09 13:28:20 +010065 receive_timeout: 5min
66 sshd:
67 threads: 64
68 batch_threads: 16
69 max_connections_per_user: 64
Ales Komarek49a37292016-08-31 16:18:31 +020070 database:
71 engine: postgresql
72 host: localhost
73 port: 5432
74 name: gerrit
75 user: gerrit
76 password: ${_param:postgresql_gerrit_password}
Jakub Josef09765e12018-01-09 13:28:20 +010077 pool_limit: 250
Sergey Otpuschennikov584698f2018-08-24 18:29:16 +040078 pool_max_idle: 16
79
80
81Gerrit LDAP authentification
82
83.. code-block:: yaml
84
85 gerrit:
86 server:
87 auth:
88 engine: LDAP
89 ldap_server: ldap://ldap.mycompany.net
90 ldap_account_base: dc=company,dc=net
91 ldap_group_base: ou=Groups,dc=company,dc=net
92
Jakub Josef09765e12018-01-09 13:28:20 +010093
94Gerrit change auto abandon
95
96.. code-block:: yaml
97
98 gerrit:
99 server:
100 change_cleanup:
101 abandon_after: 3months
Ales Komarek49a37292016-08-31 16:18:31 +0200102
Ales Komarek2fc39002016-09-14 11:43:56 +0200103
104Gerrit client enforcing groups
105
106.. code-block:: yaml
107
108 gerrit:
109 client:
110 group:
111 Admin001:
112 description: admin 01
113 Admin002:
114 description: admin 02
115
116
Filip Pytloun33d84dd2016-12-20 16:13:24 +0100117Gerrit client enforcing users, install using pip
Ales Komarek2fc39002016-09-14 11:43:56 +0200118
119.. code-block:: yaml
120
121 gerrit:
122 client:
Filip Pytloun33d84dd2016-12-20 16:13:24 +0100123 source:
124 engine: pip
Ales Komarek2fc39002016-09-14 11:43:56 +0200125 user:
126 jdoe:
127 fullname: John Doe
128 email: "jdoe@domain.com"
129 ssh_key: ssh-rsa
130 http_password: password
131 groups:
132 - Admin001
133
134
Ales Komarek49a37292016-08-31 16:18:31 +0200135Gerrit client enforcing projects
136
137.. code-block:: yaml
138
139 gerrit:
140 client:
141 enabled: True
142 server:
143 host: 10.10.10.148
144 user: newt
145 key: |
146 -----BEGIN RSA PRIVATE KEY-----
147 MIIEowIBAAKCAQEAs0Y8mxS3dfs5zG8Du5vdBkfOCOng1IEUmFZIirJ8oBgJOd54
148 QgmkDFB7oP9eTCgz9k/rix1uJWhhVCMBzrWzH5IODO+tyy/tK66pv2BWtVfTDhBA
149 ...
150 l1UrxQKBgEklBTuEiDRibKGXQBwlAYvK2He09hWpqtpt9/DVel6s4A1bbTWDHyoP
151 jvMXms60iD/A5OpG33LWHNNzQBP486SxG75LB+Xs5sp5j2/b7VF5LJLhpGiJv9Mk
152 ydbuy8iuuvali2uF133kAlLqnrWfVTYQQI1OfW5glOv1L6kv94dU
153 -----END RSA PRIVATE KEY-----
Ales Komarek50c558e2016-09-05 23:34:43 +0200154 email: "Project Creator <infra@lists.domain.com>"
Ales Komarek49a37292016-08-31 16:18:31 +0200155 project:
156 test_salt_project:
157 enabled: true
158
Ales Komarek50c558e2016-09-05 23:34:43 +0200159Gerrit client enforcing project, full project example
160
161.. code-block:: yaml
162
163 gerrit:
164 client:
165 enabled: True
166 project:
167 test_salt_project:
168 enabled: true
169 access:
170 "refs/heads/*":
171 actions:
172 - name: abandon
173 group: openstack-salt-core
174 - name: create
175 group: openstack-salt-release
176 labels:
177 - name: Code-Review
178 group: openstack-salt-core
179 score: -2..+2
180 - name: Workflow
181 group: openstack-salt-core
182 score: -1..+1
183 "refs/tags/*":
184 actions:
185 - name: pushSignedTag
186 group: openstack-salt-release
Dmitry Burmistrov9efdff82018-03-21 15:07:05 +0400187 force: true
Alexander Noskov870359d2017-11-02 13:53:15 +0400188 inherit_access: All-Projects
Ales Komarek50c558e2016-09-05 23:34:43 +0200189 require_change_id: true
190 require_agreement: true
191 merge_content: true
Alexander Noskov338d3c72017-09-19 12:10:32 +0400192 action: "fast forward only"
Ales Komarek50c558e2016-09-05 23:34:43 +0200193
Ales Komarek1acb14d2016-09-09 15:14:12 +0200194.. code-block:: yaml
195
196 gerrit:
197 client:
198 enabled: True
199 group:
200 groupname:
201 enabled: true
202 members:
203 - username
204 account:
205 username:
206 enabled: true
207 full_name: hovno
208 email: mail@newt.cz
209 public_key: rsassh
210 http_password: passwd
211
Jiri Broulik90a79c62018-04-25 20:53:45 +0200212Gerrit client proxy
213
214.. code-block:: yaml
215
216 gerrit:
217 client:
218 proxy:
219 http_proxy: http://192.168.10.15:8000
220 https_proxy: http://192.168.10.15:8000
221 no_proxy: 192.168.10.90
Ales Komarek1acb14d2016-09-09 15:14:12 +0200222
Ales Komarek50c558e2016-09-05 23:34:43 +0200223Sample project access
224
225.. code-block:: yaml
226
227 [access "refs/*"]
228 read = group Administrators
229 read = group Anonymous Users
230 [access "refs/for/refs/*"]
231 push = group Registered Users
232 pushMerge = group Registered Users
233 [access "refs/heads/*"]
234 create = group Administrators
235 create = group Project Owners
236 forgeAuthor = group Registered Users
237 forgeCommitter = group Administrators
238 forgeCommitter = group Project Owners
239 push = group Administrators
240 push = group Project Owners
241 label-Code-Review = -2..+2 group Administrators
242 label-Code-Review = -2..+2 group Project Owners
243 label-Code-Review = -1..+1 group Registered Users
244 label-Verified = -1..+1 group Non-Interactive Users
245 submit = group Administrators
246 submit = group Project Owners
247 editTopicName = +force group Administrators
248 editTopicName = +force group Project Owners
249 [access "refs/meta/config"]
250 exclusiveGroupPermissions = read
251 read = group Administrators
252 read = group Project Owners
253 push = group Administrators
254 push = group Project Owners
255 label-Code-Review = -2..+2 group Administrators
256 label-Code-Review = -2..+2 group Project Owners
257 submit = group Administrators
258 submit = group Project Owners
259 [access "refs/tags/*"]
260 pushTag = group Administrators
261 pushTag = group Project Owners
Dmitry Burmistrov9efdff82018-03-21 15:07:05 +0400262 pushSignedTag = +force group Administrators
Ales Komarek50c558e2016-09-05 23:34:43 +0200263 pushSignedTag = group Project Owners
264 [label "Code-Review"]
265 function = MaxWithBlock
266 copyMinScore = true
267 value = -2 This shall not be merged
268 value = -1 I would prefer this is not merged as is
269 value = 0 No score
270 value = +1 Looks good to me, but someone else must approve
271 value = +2 Looks good to me, approved
272 [label "Verified"]
273 function = MaxWithBlock
274 copyMinScore = true
275 value = -1 Fails
276 value = 0 No score
277 value = +1 Verified
278
Sergey Otpuschennikov42ba1582018-08-20 15:47:09 +0400279Gerrit replication enable
280
281.. code-block:: yaml
282
283 gerrit:
284 server:
285 plugin:
286 replication:
287 engine: gerrit
288 replication:
289 gerrit2.localdomain:
290 remote_url: user@gerrit2.local.domain:/var/lib/gerrit
291 remote_port: 22
292 replication_user: gerrit2
293
294For creating ssh keys use openssh state
295
Sergey Otpuschennikovb3cca132018-10-05 20:24:44 +0400296Gerrit hide CI
297
298.. code-block:: yaml
299
300 gerrit:
301 server:
302 hideci:
303 ci_user_name: ci_user
304
Ales Komarek3446a0a2016-03-08 10:21:00 +0100305Read more
306=========
307
Ales Komarek7f93ce22016-08-29 23:27:47 +0200308* https://www.gerritcodereview.com/
Ales Komarekf93ac812016-08-31 19:37:43 +0200309* https://gerrit-review.googlesource.com/Documentation/
Ales Komarek7f93ce22016-08-29 23:27:47 +0200310* https://github.com/openstack-infra/puppet-gerrit/
311* https://gerrit-ci.gerritforge.com/
Ales Komarek10526762016-09-19 15:21:46 +0200312* https://github.com/morucci/exzuul
Filip Pytlounc5f32652017-02-02 13:02:03 +0100313
OlgaGusarenkocb981942018-07-30 17:26:31 +0300314Documentation and bugs
Filip Pytlounc5f32652017-02-02 13:02:03 +0100315======================
316
OlgaGusarenkocb981942018-07-30 17:26:31 +0300317* http://salt-formulas.readthedocs.io/
318 Learn how to install and update salt-formulas
Filip Pytlounc5f32652017-02-02 13:02:03 +0100319
OlgaGusarenkocb981942018-07-30 17:26:31 +0300320* https://github.com/salt-formulas/salt-formula-gerrit/issues
321 In the unfortunate event that bugs are discovered, report the issue to the
322 appropriate issue tracker. Use the Github issue tracker for a specific salt
323 formula
Filip Pytlounc5f32652017-02-02 13:02:03 +0100324
OlgaGusarenkocb981942018-07-30 17:26:31 +0300325* https://launchpad.net/salt-formulas
326 For feature requests, bug reports, or blueprints affecting the entire
327 ecosystem, use the Launchpad salt-formulas project
Filip Pytlounc5f32652017-02-02 13:02:03 +0100328
OlgaGusarenkocb981942018-07-30 17:26:31 +0300329* https://launchpad.net/~salt-formulas-users
330 Join the salt-formulas-users team and subscribe to mailing list if required
Filip Pytlounc5f32652017-02-02 13:02:03 +0100331
OlgaGusarenkocb981942018-07-30 17:26:31 +0300332* https://github.com/salt-formulas/salt-formula-gerrit
333 Develop the salt-formulas projects in the master branch and then submit pull
334 requests against a specific formula
Filip Pytlounc5f32652017-02-02 13:02:03 +0100335
OlgaGusarenkocb981942018-07-30 17:26:31 +0300336* #salt-formulas @ irc.freenode.net
337 Use this IRC channel in case of any questions or feedback which is always
338 welcome
Filip Pytlounc5f32652017-02-02 13:02:03 +0100339