blob: dc9ff56405f6ddf5a06d2a4f5d0b6dbdc96a3c11 [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:
29 canonical_web_url: http://10.10.10.148:8082/
30 email_private_key: ""
31 token_private_key: ""
32 initial_user:
33 full_name: John Doe
34 email: 'mail@jdoe.com'
35 username: jdoe
36 plugin:
37 download-commands:
38 engine: gerrit
39 # replication:
40 # engine: gerrit
41 reviewnotes:
42 engine: gerrit
43 singleusergroup:
44 engine: gerrit
45 ssh_rsa_key: |
46 -----BEGIN RSA PRIVATE KEY-----
47 MIIEowIBAAKCAQEAs0Y8mxS3dfs5zG8Du5vdBkfOCOng1IEUmFZIirJ8oBgJOd54
48 QgmkDFB7oP9eTCgz9k/rix1uJWhhVCMBzrWzH5IODO+tyy/tK66pv2BWtVfTDhBA
49 nShOLDNbSIBaV8E/NcrbnQN+b0alp4N7rQnavkOYl+JQncKjz1csmCodirscB9Oj
50 rdo6NG9olv9IQd/tDQxEeDyQkoW50aCEWcq7o+QaTzgnlrL+XZEzhzjdcvA9m8go
51 ...
52 jvMXms60iD/A5OpG33LWHNNzQBP486SxG75LB+Xs5sp5j2/b7VF5LJLhpGiJv9Mk
53 ydbuy8iuuvali2uF133kAlLqnrWfVTYQQI1OfW5glOv1L6kv94dU
54 -----END RSA PRIVATE KEY-----
55 ssh_rsa_key_pub: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzRjybFLd1+znMbwO7m90GR84I6eDUgRSYVkiKsnygGAk53nhCCaQMUHug/15MKDP2T+uLHW4laGFUIwHOtbMfkg4M763LL+0rrqm/YFa1V9MOEECdKE4sM1tIgFpXwT81ytudA35vRqWng3utCdq+Q5iX4lCdwqPPVyyYKh2KuxwH06Ot2jo0b2iW/0hB3+0NDER4PJCShbnRoIRZyruj5BpPOCeWsv5dkTOHON1y8D2byCgNGdCBIRx7x9Qb4dKK2F01r0/bfBGxELJzBdQ8XO14bQ7VOd3gTxrccTM4tVS7/uc/vtjiq7MKjnHGf/svbw9bTHAXbXcWXtOlRe51
56 email: mail@domain.com
57 auth:
58 engine: HTTP
59 source:
60 engine: http
61 address: https://gerrit-releases.storage.googleapis.com/gerrit-2.12.4.war
62 hash: sha256=45786a920a929c6258de6461bcf03ddec8925577bd485905f102ceb6e5e1e47c
63 database:
64 engine: postgresql
65 host: localhost
66 port: 5432
67 name: gerrit
68 user: gerrit
69 password: ${_param:postgresql_gerrit_password}
70
Ales Komarek2fc39002016-09-14 11:43:56 +020071
72Gerrit client enforcing groups
73
74.. code-block:: yaml
75
76 gerrit:
77 client:
78 group:
79 Admin001:
80 description: admin 01
81 Admin002:
82 description: admin 02
83
84
85Gerrit client enforcing users
86
87.. code-block:: yaml
88
89 gerrit:
90 client:
91 user:
92 jdoe:
93 fullname: John Doe
94 email: "jdoe@domain.com"
95 ssh_key: ssh-rsa
96 http_password: password
97 groups:
98 - Admin001
99
100
Ales Komarek49a37292016-08-31 16:18:31 +0200101Gerrit client enforcing projects
102
103.. code-block:: yaml
104
105 gerrit:
106 client:
107 enabled: True
108 server:
109 host: 10.10.10.148
110 user: newt
111 key: |
112 -----BEGIN RSA PRIVATE KEY-----
113 MIIEowIBAAKCAQEAs0Y8mxS3dfs5zG8Du5vdBkfOCOng1IEUmFZIirJ8oBgJOd54
114 QgmkDFB7oP9eTCgz9k/rix1uJWhhVCMBzrWzH5IODO+tyy/tK66pv2BWtVfTDhBA
115 ...
116 l1UrxQKBgEklBTuEiDRibKGXQBwlAYvK2He09hWpqtpt9/DVel6s4A1bbTWDHyoP
117 jvMXms60iD/A5OpG33LWHNNzQBP486SxG75LB+Xs5sp5j2/b7VF5LJLhpGiJv9Mk
118 ydbuy8iuuvali2uF133kAlLqnrWfVTYQQI1OfW5glOv1L6kv94dU
119 -----END RSA PRIVATE KEY-----
Ales Komarek50c558e2016-09-05 23:34:43 +0200120 email: "Project Creator <infra@lists.domain.com>"
Ales Komarek49a37292016-08-31 16:18:31 +0200121 project:
122 test_salt_project:
123 enabled: true
124
Ales Komarek50c558e2016-09-05 23:34:43 +0200125Gerrit client enforcing project, full project example
126
127.. code-block:: yaml
128
129 gerrit:
130 client:
131 enabled: True
132 project:
133 test_salt_project:
134 enabled: true
135 access:
136 "refs/heads/*":
137 actions:
138 - name: abandon
139 group: openstack-salt-core
140 - name: create
141 group: openstack-salt-release
142 labels:
143 - name: Code-Review
144 group: openstack-salt-core
145 score: -2..+2
146 - name: Workflow
147 group: openstack-salt-core
148 score: -1..+1
149 "refs/tags/*":
150 actions:
151 - name: pushSignedTag
152 group: openstack-salt-release
153 require_change_id: true
154 require_agreement: true
155 merge_content: true
156
Ales Komarek131012f2016-09-09 15:14:12 +0200157
158.. code-block:: yaml
159
160 gerrit:
161 client:
162 enabled: True
163 group:
164 groupname:
165 enabled: true
166 members:
167 - username
168 account:
169 username:
170 enabled: true
171 full_name: hovno
172 email: mail@newt.cz
173 public_key: rsassh
174 http_password: passwd
175
176
Ales Komarek50c558e2016-09-05 23:34:43 +0200177Sample project access
178
179.. code-block:: yaml
180
181 [access "refs/*"]
182 read = group Administrators
183 read = group Anonymous Users
184 [access "refs/for/refs/*"]
185 push = group Registered Users
186 pushMerge = group Registered Users
187 [access "refs/heads/*"]
188 create = group Administrators
189 create = group Project Owners
190 forgeAuthor = group Registered Users
191 forgeCommitter = group Administrators
192 forgeCommitter = group Project Owners
193 push = group Administrators
194 push = group Project Owners
195 label-Code-Review = -2..+2 group Administrators
196 label-Code-Review = -2..+2 group Project Owners
197 label-Code-Review = -1..+1 group Registered Users
198 label-Verified = -1..+1 group Non-Interactive Users
199 submit = group Administrators
200 submit = group Project Owners
201 editTopicName = +force group Administrators
202 editTopicName = +force group Project Owners
203 [access "refs/meta/config"]
204 exclusiveGroupPermissions = read
205 read = group Administrators
206 read = group Project Owners
207 push = group Administrators
208 push = group Project Owners
209 label-Code-Review = -2..+2 group Administrators
210 label-Code-Review = -2..+2 group Project Owners
211 submit = group Administrators
212 submit = group Project Owners
213 [access "refs/tags/*"]
214 pushTag = group Administrators
215 pushTag = group Project Owners
216 pushSignedTag = group Administrators
217 pushSignedTag = group Project Owners
218 [label "Code-Review"]
219 function = MaxWithBlock
220 copyMinScore = true
221 value = -2 This shall not be merged
222 value = -1 I would prefer this is not merged as is
223 value = 0 No score
224 value = +1 Looks good to me, but someone else must approve
225 value = +2 Looks good to me, approved
226 [label "Verified"]
227 function = MaxWithBlock
228 copyMinScore = true
229 value = -1 Fails
230 value = 0 No score
231 value = +1 Verified
232
Ales Komarek3446a0a2016-03-08 10:21:00 +0100233Read more
234=========
235
Ales Komarek7f93ce22016-08-29 23:27:47 +0200236* https://www.gerritcodereview.com/
Ales Komarekf93ac812016-08-31 19:37:43 +0200237* https://gerrit-review.googlesource.com/Documentation/
Ales Komarek7f93ce22016-08-29 23:27:47 +0200238* https://github.com/openstack-infra/puppet-gerrit/
239* https://gerrit-ci.gerritforge.com/
Ales Komarekf93ac812016-08-31 19:37:43 +0200240* https://github.com/morucci/exzuul