Ales Komarek | 3446a0a | 2016-03-08 10:21:00 +0100 | [diff] [blame] | 1 | |
Ales Komarek | 7f93ce2 | 2016-08-29 23:27:47 +0200 | [diff] [blame] | 2 | ====== |
| 3 | Gerrit |
| 4 | ====== |
Ales Komarek | 3446a0a | 2016-03-08 10:21:00 +0100 | [diff] [blame] | 5 | |
Ales Komarek | 7f93ce2 | 2016-08-29 23:27:47 +0200 | [diff] [blame] | 6 | Gerrit provides web based code review and repository management for the Git version control system. |
Ales Komarek | 3446a0a | 2016-03-08 10:21:00 +0100 | [diff] [blame] | 7 | |
| 8 | Sample pillars |
| 9 | ============== |
| 10 | |
Ales Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 11 | Simple gerrit service |
Ales Komarek | 3446a0a | 2016-03-08 10:21:00 +0100 | [diff] [blame] | 12 | |
| 13 | .. code-block:: yaml |
| 14 | |
| 15 | gerrit: |
| 16 | server: |
| 17 | enabled: true |
Ales Komarek | 7f93ce2 | 2016-08-29 23:27:47 +0200 | [diff] [blame] | 18 | 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 Komarek | 3446a0a | 2016-03-08 10:21:00 +0100 | [diff] [blame] | 22 | |
Ales Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 23 | Full service setup |
| 24 | |
| 25 | .. code-block:: yaml |
| 26 | |
| 27 | gerrit: |
| 28 | server: |
Martin Polreich | 5ec9e54 | 2018-07-17 13:54:55 +0200 | [diff] [blame] | 29 | enabled: true |
Ales Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 30 | 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 Josef | 09765e1 | 2018-01-09 13:28:20 +0100 | [diff] [blame] | 64 | receive_timeout: 5min |
| 65 | sshd: |
| 66 | threads: 64 |
| 67 | batch_threads: 16 |
| 68 | max_connections_per_user: 64 |
Ales Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 69 | database: |
| 70 | engine: postgresql |
| 71 | host: localhost |
| 72 | port: 5432 |
| 73 | name: gerrit |
| 74 | user: gerrit |
| 75 | password: ${_param:postgresql_gerrit_password} |
Jakub Josef | 09765e1 | 2018-01-09 13:28:20 +0100 | [diff] [blame] | 76 | pool_limit: 250 |
| 77 | pool_max_idle: 16 |
| 78 | |
| 79 | Gerrit change auto abandon |
| 80 | |
| 81 | .. code-block:: yaml |
| 82 | |
| 83 | gerrit: |
| 84 | server: |
| 85 | change_cleanup: |
| 86 | abandon_after: 3months |
Ales Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 87 | |
Ales Komarek | 2fc3900 | 2016-09-14 11:43:56 +0200 | [diff] [blame] | 88 | |
| 89 | Gerrit 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 Pytloun | 33d84dd | 2016-12-20 16:13:24 +0100 | [diff] [blame] | 102 | Gerrit client enforcing users, install using pip |
Ales Komarek | 2fc3900 | 2016-09-14 11:43:56 +0200 | [diff] [blame] | 103 | |
| 104 | .. code-block:: yaml |
| 105 | |
| 106 | gerrit: |
| 107 | client: |
Filip Pytloun | 33d84dd | 2016-12-20 16:13:24 +0100 | [diff] [blame] | 108 | source: |
| 109 | engine: pip |
Ales Komarek | 2fc3900 | 2016-09-14 11:43:56 +0200 | [diff] [blame] | 110 | 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 Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 120 | Gerrit 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 Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 139 | email: "Project Creator <infra@lists.domain.com>" |
Ales Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 140 | project: |
| 141 | test_salt_project: |
| 142 | enabled: true |
| 143 | |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 144 | Gerrit 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 Burmistrov | 9efdff8 | 2018-03-21 15:07:05 +0400 | [diff] [blame] | 172 | force: true |
Alexander Noskov | 870359d | 2017-11-02 13:53:15 +0400 | [diff] [blame] | 173 | inherit_access: All-Projects |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 174 | require_change_id: true |
| 175 | require_agreement: true |
| 176 | merge_content: true |
Alexander Noskov | 338d3c7 | 2017-09-19 12:10:32 +0400 | [diff] [blame] | 177 | action: "fast forward only" |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 178 | |
Ales Komarek | 1acb14d | 2016-09-09 15:14:12 +0200 | [diff] [blame] | 179 | |
| 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 Broulik | 90a79c6 | 2018-04-25 20:53:45 +0200 | [diff] [blame] | 198 | Gerrit 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 Komarek | 1acb14d | 2016-09-09 15:14:12 +0200 | [diff] [blame] | 208 | |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 209 | Sample 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 Burmistrov | 9efdff8 | 2018-03-21 15:07:05 +0400 | [diff] [blame] | 248 | pushSignedTag = +force group Administrators |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 249 | 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 Komarek | 3446a0a | 2016-03-08 10:21:00 +0100 | [diff] [blame] | 265 | Read more |
| 266 | ========= |
| 267 | |
Ales Komarek | 7f93ce2 | 2016-08-29 23:27:47 +0200 | [diff] [blame] | 268 | * https://www.gerritcodereview.com/ |
Ales Komarek | f93ac81 | 2016-08-31 19:37:43 +0200 | [diff] [blame] | 269 | * https://gerrit-review.googlesource.com/Documentation/ |
Ales Komarek | 7f93ce2 | 2016-08-29 23:27:47 +0200 | [diff] [blame] | 270 | * https://github.com/openstack-infra/puppet-gerrit/ |
| 271 | * https://gerrit-ci.gerritforge.com/ |
Ales Komarek | 1052676 | 2016-09-19 15:21:46 +0200 | [diff] [blame] | 272 | * https://github.com/morucci/exzuul |
Filip Pytloun | c5f3265 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 273 | |
| 274 | Documentation and Bugs |
| 275 | ====================== |
| 276 | |
| 277 | To learn how to install and update salt-formulas, consult the documentation |
| 278 | available online at: |
| 279 | |
| 280 | http://salt-formulas.readthedocs.io/ |
| 281 | |
| 282 | In the unfortunate event that bugs are discovered, they should be reported to |
| 283 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 284 | formula: |
| 285 | |
| 286 | https://github.com/salt-formulas/salt-formula-gerrit/issues |
| 287 | |
| 288 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 289 | use Launchpad salt-formulas project: |
| 290 | |
| 291 | https://launchpad.net/salt-formulas |
| 292 | |
| 293 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 294 | |
| 295 | https://launchpad.net/~salt-formulas-users |
| 296 | |
| 297 | Developers wishing to work on the salt-formulas projects should always base |
| 298 | their work on master branch and submit pull request against specific formula. |
| 299 | |
| 300 | https://github.com/salt-formulas/salt-formula-gerrit |
| 301 | |
| 302 | Any questions or feedback is always welcome so feel free to join our IRC |
| 303 | channel: |
| 304 | |
| 305 | #salt-formulas @ irc.freenode.net |