blob: 19ffe2cbda79f1d78196831fd0e78840f2129101 [file] [log] [blame]
Ales Komarek3446a0a2016-03-08 10:21:00 +01001
Ales Komarek7f93ce22016-08-29 23:27:47 +02002======
3Gerrit
4======
Ales Komarek3446a0a2016-03-08 10:21:00 +01005
Ales Komarek7f93ce22016-08-29 23:27:47 +02006Gerrit provides web based code review and repository management for the Git version control system.
Ales Komarek3446a0a2016-03-08 10:21:00 +01007
8Sample pillars
9==============
10
Ales Komarek49a37292016-08-31 16:18:31 +020011Simple gerrit service
Ales Komarek3446a0a2016-03-08 10:21:00 +010012
13.. code-block:: yaml
14
15 gerrit:
16 server:
17 enabled: true
Ales Komarek7f93ce22016-08-29 23:27:47 +020018 source:
19 engine: http
20 address: https://gerrit-ci.gerritforge.com/job/Gerrit-stable-2.13/20/artifact/buck-out/gen/gerrit.war
21 hash: 2e17064b8742c4622815593ec496c571
Ales Komarek3446a0a2016-03-08 10:21:00 +010022
Ales Komarek49a37292016-08-31 16:18:31 +020023Full service setup
24
25.. code-block:: yaml
26
27 gerrit:
28 server:
Martin Polreich5ec9e542018-07-17 13:54:55 +020029 enabled: true
Ales Komarek49a37292016-08-31 16:18:31 +020030 canonical_web_url: http://10.10.10.148:8082/
31 email_private_key: ""
32 token_private_key: ""
33 initial_user:
34 full_name: John Doe
35 email: 'mail@jdoe.com'
36 username: jdoe
37 plugin:
38 download-commands:
39 engine: gerrit
40 # replication:
41 # engine: gerrit
42 reviewnotes:
43 engine: gerrit
44 singleusergroup:
45 engine: gerrit
46 ssh_rsa_key: |
47 -----BEGIN RSA PRIVATE KEY-----
48 MIIEowIBAAKCAQEAs0Y8mxS3dfs5zG8Du5vdBkfOCOng1IEUmFZIirJ8oBgJOd54
49 QgmkDFB7oP9eTCgz9k/rix1uJWhhVCMBzrWzH5IODO+tyy/tK66pv2BWtVfTDhBA
50 nShOLDNbSIBaV8E/NcrbnQN+b0alp4N7rQnavkOYl+JQncKjz1csmCodirscB9Oj
51 rdo6NG9olv9IQd/tDQxEeDyQkoW50aCEWcq7o+QaTzgnlrL+XZEzhzjdcvA9m8go
52 ...
53 jvMXms60iD/A5OpG33LWHNNzQBP486SxG75LB+Xs5sp5j2/b7VF5LJLhpGiJv9Mk
54 ydbuy8iuuvali2uF133kAlLqnrWfVTYQQI1OfW5glOv1L6kv94dU
55 -----END RSA PRIVATE KEY-----
56 ssh_rsa_key_pub: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzRjybFLd1+znMbwO7m90GR84I6eDUgRSYVkiKsnygGAk53nhCCaQMUHug/15MKDP2T+uLHW4laGFUIwHOtbMfkg4M763LL+0rrqm/YFa1V9MOEECdKE4sM1tIgFpXwT81ytudA35vRqWng3utCdq+Q5iX4lCdwqPPVyyYKh2KuxwH06Ot2jo0b2iW/0hB3+0NDER4PJCShbnRoIRZyruj5BpPOCeWsv5dkTOHON1y8D2byCgNGdCBIRx7x9Qb4dKK2F01r0/bfBGxELJzBdQ8XO14bQ7VOd3gTxrccTM4tVS7/uc/vtjiq7MKjnHGf/svbw9bTHAXbXcWXtOlRe51
57 email: mail@domain.com
58 auth:
59 engine: HTTP
60 source:
61 engine: http
62 address: https://gerrit-releases.storage.googleapis.com/gerrit-2.12.4.war
63 hash: sha256=45786a920a929c6258de6461bcf03ddec8925577bd485905f102ceb6e5e1e47c
Jakub Josef09765e12018-01-09 13:28:20 +010064 receive_timeout: 5min
65 sshd:
66 threads: 64
67 batch_threads: 16
68 max_connections_per_user: 64
Ales Komarek49a37292016-08-31 16:18:31 +020069 database:
70 engine: postgresql
71 host: localhost
72 port: 5432
73 name: gerrit
74 user: gerrit
75 password: ${_param:postgresql_gerrit_password}
Jakub Josef09765e12018-01-09 13:28:20 +010076 pool_limit: 250
77 pool_max_idle: 16
78
79Gerrit change auto abandon
80
81.. code-block:: yaml
82
83 gerrit:
84 server:
85 change_cleanup:
86 abandon_after: 3months
Ales Komarek49a37292016-08-31 16:18:31 +020087
Ales Komarek2fc39002016-09-14 11:43:56 +020088
89Gerrit client enforcing groups
90
91.. code-block:: yaml
92
93 gerrit:
94 client:
95 group:
96 Admin001:
97 description: admin 01
98 Admin002:
99 description: admin 02
100
101
Filip Pytloun33d84dd2016-12-20 16:13:24 +0100102Gerrit client enforcing users, install using pip
Ales Komarek2fc39002016-09-14 11:43:56 +0200103
104.. code-block:: yaml
105
106 gerrit:
107 client:
Filip Pytloun33d84dd2016-12-20 16:13:24 +0100108 source:
109 engine: pip
Ales Komarek2fc39002016-09-14 11:43:56 +0200110 user:
111 jdoe:
112 fullname: John Doe
113 email: "jdoe@domain.com"
114 ssh_key: ssh-rsa
115 http_password: password
116 groups:
117 - Admin001
118
119
Ales Komarek49a37292016-08-31 16:18:31 +0200120Gerrit client enforcing projects
121
122.. code-block:: yaml
123
124 gerrit:
125 client:
126 enabled: True
127 server:
128 host: 10.10.10.148
129 user: newt
130 key: |
131 -----BEGIN RSA PRIVATE KEY-----
132 MIIEowIBAAKCAQEAs0Y8mxS3dfs5zG8Du5vdBkfOCOng1IEUmFZIirJ8oBgJOd54
133 QgmkDFB7oP9eTCgz9k/rix1uJWhhVCMBzrWzH5IODO+tyy/tK66pv2BWtVfTDhBA
134 ...
135 l1UrxQKBgEklBTuEiDRibKGXQBwlAYvK2He09hWpqtpt9/DVel6s4A1bbTWDHyoP
136 jvMXms60iD/A5OpG33LWHNNzQBP486SxG75LB+Xs5sp5j2/b7VF5LJLhpGiJv9Mk
137 ydbuy8iuuvali2uF133kAlLqnrWfVTYQQI1OfW5glOv1L6kv94dU
138 -----END RSA PRIVATE KEY-----
Ales Komarek50c558e2016-09-05 23:34:43 +0200139 email: "Project Creator <infra@lists.domain.com>"
Ales Komarek49a37292016-08-31 16:18:31 +0200140 project:
141 test_salt_project:
142 enabled: true
143
Ales Komarek50c558e2016-09-05 23:34:43 +0200144Gerrit client enforcing project, full project example
145
146.. code-block:: yaml
147
148 gerrit:
149 client:
150 enabled: True
151 project:
152 test_salt_project:
153 enabled: true
154 access:
155 "refs/heads/*":
156 actions:
157 - name: abandon
158 group: openstack-salt-core
159 - name: create
160 group: openstack-salt-release
161 labels:
162 - name: Code-Review
163 group: openstack-salt-core
164 score: -2..+2
165 - name: Workflow
166 group: openstack-salt-core
167 score: -1..+1
168 "refs/tags/*":
169 actions:
170 - name: pushSignedTag
171 group: openstack-salt-release
Dmitry Burmistrov9efdff82018-03-21 15:07:05 +0400172 force: true
Alexander Noskov870359d2017-11-02 13:53:15 +0400173 inherit_access: All-Projects
Ales Komarek50c558e2016-09-05 23:34:43 +0200174 require_change_id: true
175 require_agreement: true
176 merge_content: true
Alexander Noskov338d3c72017-09-19 12:10:32 +0400177 action: "fast forward only"
Ales Komarek50c558e2016-09-05 23:34:43 +0200178
Ales Komarek1acb14d2016-09-09 15:14:12 +0200179
180.. code-block:: yaml
181
182 gerrit:
183 client:
184 enabled: True
185 group:
186 groupname:
187 enabled: true
188 members:
189 - username
190 account:
191 username:
192 enabled: true
193 full_name: hovno
194 email: mail@newt.cz
195 public_key: rsassh
196 http_password: passwd
197
Jiri Broulik90a79c62018-04-25 20:53:45 +0200198Gerrit client proxy
199
200.. code-block:: yaml
201
202 gerrit:
203 client:
204 proxy:
205 http_proxy: http://192.168.10.15:8000
206 https_proxy: http://192.168.10.15:8000
207 no_proxy: 192.168.10.90
Ales Komarek1acb14d2016-09-09 15:14:12 +0200208
Ales Komarek50c558e2016-09-05 23:34:43 +0200209Sample project access
210
211.. code-block:: yaml
212
213 [access "refs/*"]
214 read = group Administrators
215 read = group Anonymous Users
216 [access "refs/for/refs/*"]
217 push = group Registered Users
218 pushMerge = group Registered Users
219 [access "refs/heads/*"]
220 create = group Administrators
221 create = group Project Owners
222 forgeAuthor = group Registered Users
223 forgeCommitter = group Administrators
224 forgeCommitter = group Project Owners
225 push = group Administrators
226 push = group Project Owners
227 label-Code-Review = -2..+2 group Administrators
228 label-Code-Review = -2..+2 group Project Owners
229 label-Code-Review = -1..+1 group Registered Users
230 label-Verified = -1..+1 group Non-Interactive Users
231 submit = group Administrators
232 submit = group Project Owners
233 editTopicName = +force group Administrators
234 editTopicName = +force group Project Owners
235 [access "refs/meta/config"]
236 exclusiveGroupPermissions = read
237 read = group Administrators
238 read = 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 submit = group Administrators
244 submit = group Project Owners
245 [access "refs/tags/*"]
246 pushTag = group Administrators
247 pushTag = group Project Owners
Dmitry Burmistrov9efdff82018-03-21 15:07:05 +0400248 pushSignedTag = +force group Administrators
Ales Komarek50c558e2016-09-05 23:34:43 +0200249 pushSignedTag = group Project Owners
250 [label "Code-Review"]
251 function = MaxWithBlock
252 copyMinScore = true
253 value = -2 This shall not be merged
254 value = -1 I would prefer this is not merged as is
255 value = 0 No score
256 value = +1 Looks good to me, but someone else must approve
257 value = +2 Looks good to me, approved
258 [label "Verified"]
259 function = MaxWithBlock
260 copyMinScore = true
261 value = -1 Fails
262 value = 0 No score
263 value = +1 Verified
264
Ales Komarek3446a0a2016-03-08 10:21:00 +0100265Read more
266=========
267
Ales Komarek7f93ce22016-08-29 23:27:47 +0200268* https://www.gerritcodereview.com/
Ales Komarekf93ac812016-08-31 19:37:43 +0200269* https://gerrit-review.googlesource.com/Documentation/
Ales Komarek7f93ce22016-08-29 23:27:47 +0200270* https://github.com/openstack-infra/puppet-gerrit/
271* https://gerrit-ci.gerritforge.com/
Ales Komarek10526762016-09-19 15:21:46 +0200272* https://github.com/morucci/exzuul
Filip Pytlounc5f32652017-02-02 13:02:03 +0100273
274Documentation and Bugs
275======================
276
277To learn how to install and update salt-formulas, consult the documentation
278available online at:
279
280 http://salt-formulas.readthedocs.io/
281
282In the unfortunate event that bugs are discovered, they should be reported to
283the appropriate issue tracker. Use Github issue tracker for specific salt
284formula:
285
286 https://github.com/salt-formulas/salt-formula-gerrit/issues
287
288For feature requests, bug reports or blueprints affecting entire ecosystem,
289use Launchpad salt-formulas project:
290
291 https://launchpad.net/salt-formulas
292
293You can also join salt-formulas-users team and subscribe to mailing list:
294
295 https://launchpad.net/~salt-formulas-users
296
297Developers wishing to work on the salt-formulas projects should always base
298their work on master branch and submit pull request against specific formula.
299
300 https://github.com/salt-formulas/salt-formula-gerrit
301
302Any questions or feedback is always welcome so feel free to join our IRC
303channel:
304
305 #salt-formulas @ irc.freenode.net