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: |
| 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 |
Jakub Josef | 09765e1 | 2018-01-09 13:28:20 +0100 | [diff] [blame^] | 63 | receive_timeout: 5min |
| 64 | sshd: |
| 65 | threads: 64 |
| 66 | batch_threads: 16 |
| 67 | max_connections_per_user: 64 |
Ales Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 68 | database: |
| 69 | engine: postgresql |
| 70 | host: localhost |
| 71 | port: 5432 |
| 72 | name: gerrit |
| 73 | user: gerrit |
| 74 | password: ${_param:postgresql_gerrit_password} |
Jakub Josef | 09765e1 | 2018-01-09 13:28:20 +0100 | [diff] [blame^] | 75 | pool_limit: 250 |
| 76 | pool_max_idle: 16 |
| 77 | |
| 78 | Gerrit change auto abandon |
| 79 | |
| 80 | .. code-block:: yaml |
| 81 | |
| 82 | gerrit: |
| 83 | server: |
| 84 | change_cleanup: |
| 85 | abandon_after: 3months |
Ales Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 86 | |
Ales Komarek | 2fc3900 | 2016-09-14 11:43:56 +0200 | [diff] [blame] | 87 | |
| 88 | Gerrit client enforcing groups |
| 89 | |
| 90 | .. code-block:: yaml |
| 91 | |
| 92 | gerrit: |
| 93 | client: |
| 94 | group: |
| 95 | Admin001: |
| 96 | description: admin 01 |
| 97 | Admin002: |
| 98 | description: admin 02 |
| 99 | |
| 100 | |
Filip Pytloun | 33d84dd | 2016-12-20 16:13:24 +0100 | [diff] [blame] | 101 | Gerrit client enforcing users, install using pip |
Ales Komarek | 2fc3900 | 2016-09-14 11:43:56 +0200 | [diff] [blame] | 102 | |
| 103 | .. code-block:: yaml |
| 104 | |
| 105 | gerrit: |
| 106 | client: |
Filip Pytloun | 33d84dd | 2016-12-20 16:13:24 +0100 | [diff] [blame] | 107 | source: |
| 108 | engine: pip |
Ales Komarek | 2fc3900 | 2016-09-14 11:43:56 +0200 | [diff] [blame] | 109 | user: |
| 110 | jdoe: |
| 111 | fullname: John Doe |
| 112 | email: "jdoe@domain.com" |
| 113 | ssh_key: ssh-rsa |
| 114 | http_password: password |
| 115 | groups: |
| 116 | - Admin001 |
| 117 | |
| 118 | |
Ales Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 119 | Gerrit client enforcing projects |
| 120 | |
| 121 | .. code-block:: yaml |
| 122 | |
| 123 | gerrit: |
| 124 | client: |
| 125 | enabled: True |
| 126 | server: |
| 127 | host: 10.10.10.148 |
| 128 | user: newt |
| 129 | key: | |
| 130 | -----BEGIN RSA PRIVATE KEY----- |
| 131 | MIIEowIBAAKCAQEAs0Y8mxS3dfs5zG8Du5vdBkfOCOng1IEUmFZIirJ8oBgJOd54 |
| 132 | QgmkDFB7oP9eTCgz9k/rix1uJWhhVCMBzrWzH5IODO+tyy/tK66pv2BWtVfTDhBA |
| 133 | ... |
| 134 | l1UrxQKBgEklBTuEiDRibKGXQBwlAYvK2He09hWpqtpt9/DVel6s4A1bbTWDHyoP |
| 135 | jvMXms60iD/A5OpG33LWHNNzQBP486SxG75LB+Xs5sp5j2/b7VF5LJLhpGiJv9Mk |
| 136 | ydbuy8iuuvali2uF133kAlLqnrWfVTYQQI1OfW5glOv1L6kv94dU |
| 137 | -----END RSA PRIVATE KEY----- |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 138 | email: "Project Creator <infra@lists.domain.com>" |
Ales Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 139 | project: |
| 140 | test_salt_project: |
| 141 | enabled: true |
| 142 | |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 143 | Gerrit client enforcing project, full project example |
| 144 | |
| 145 | .. code-block:: yaml |
| 146 | |
| 147 | gerrit: |
| 148 | client: |
| 149 | enabled: True |
| 150 | project: |
| 151 | test_salt_project: |
| 152 | enabled: true |
| 153 | access: |
| 154 | "refs/heads/*": |
| 155 | actions: |
| 156 | - name: abandon |
| 157 | group: openstack-salt-core |
| 158 | - name: create |
| 159 | group: openstack-salt-release |
| 160 | labels: |
| 161 | - name: Code-Review |
| 162 | group: openstack-salt-core |
| 163 | score: -2..+2 |
| 164 | - name: Workflow |
| 165 | group: openstack-salt-core |
| 166 | score: -1..+1 |
| 167 | "refs/tags/*": |
| 168 | actions: |
| 169 | - name: pushSignedTag |
| 170 | group: openstack-salt-release |
Alexander Noskov | 870359d | 2017-11-02 13:53:15 +0400 | [diff] [blame] | 171 | inherit_access: All-Projects |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 172 | require_change_id: true |
| 173 | require_agreement: true |
| 174 | merge_content: true |
Alexander Noskov | 338d3c7 | 2017-09-19 12:10:32 +0400 | [diff] [blame] | 175 | action: "fast forward only" |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 176 | |
Ales Komarek | 1acb14d | 2016-09-09 15:14:12 +0200 | [diff] [blame] | 177 | |
| 178 | .. code-block:: yaml |
| 179 | |
| 180 | gerrit: |
| 181 | client: |
| 182 | enabled: True |
| 183 | group: |
| 184 | groupname: |
| 185 | enabled: true |
| 186 | members: |
| 187 | - username |
| 188 | account: |
| 189 | username: |
| 190 | enabled: true |
| 191 | full_name: hovno |
| 192 | email: mail@newt.cz |
| 193 | public_key: rsassh |
| 194 | http_password: passwd |
| 195 | |
| 196 | |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 197 | Sample project access |
| 198 | |
| 199 | .. code-block:: yaml |
| 200 | |
| 201 | [access "refs/*"] |
| 202 | read = group Administrators |
| 203 | read = group Anonymous Users |
| 204 | [access "refs/for/refs/*"] |
| 205 | push = group Registered Users |
| 206 | pushMerge = group Registered Users |
| 207 | [access "refs/heads/*"] |
| 208 | create = group Administrators |
| 209 | create = group Project Owners |
| 210 | forgeAuthor = group Registered Users |
| 211 | forgeCommitter = group Administrators |
| 212 | forgeCommitter = group Project Owners |
| 213 | push = group Administrators |
| 214 | push = group Project Owners |
| 215 | label-Code-Review = -2..+2 group Administrators |
| 216 | label-Code-Review = -2..+2 group Project Owners |
| 217 | label-Code-Review = -1..+1 group Registered Users |
| 218 | label-Verified = -1..+1 group Non-Interactive Users |
| 219 | submit = group Administrators |
| 220 | submit = group Project Owners |
| 221 | editTopicName = +force group Administrators |
| 222 | editTopicName = +force group Project Owners |
| 223 | [access "refs/meta/config"] |
| 224 | exclusiveGroupPermissions = read |
| 225 | read = group Administrators |
| 226 | read = group Project Owners |
| 227 | push = group Administrators |
| 228 | push = group Project Owners |
| 229 | label-Code-Review = -2..+2 group Administrators |
| 230 | label-Code-Review = -2..+2 group Project Owners |
| 231 | submit = group Administrators |
| 232 | submit = group Project Owners |
| 233 | [access "refs/tags/*"] |
| 234 | pushTag = group Administrators |
| 235 | pushTag = group Project Owners |
| 236 | pushSignedTag = group Administrators |
| 237 | pushSignedTag = group Project Owners |
| 238 | [label "Code-Review"] |
| 239 | function = MaxWithBlock |
| 240 | copyMinScore = true |
| 241 | value = -2 This shall not be merged |
| 242 | value = -1 I would prefer this is not merged as is |
| 243 | value = 0 No score |
| 244 | value = +1 Looks good to me, but someone else must approve |
| 245 | value = +2 Looks good to me, approved |
| 246 | [label "Verified"] |
| 247 | function = MaxWithBlock |
| 248 | copyMinScore = true |
| 249 | value = -1 Fails |
| 250 | value = 0 No score |
| 251 | value = +1 Verified |
| 252 | |
Ales Komarek | 3446a0a | 2016-03-08 10:21:00 +0100 | [diff] [blame] | 253 | Read more |
| 254 | ========= |
| 255 | |
Ales Komarek | 7f93ce2 | 2016-08-29 23:27:47 +0200 | [diff] [blame] | 256 | * https://www.gerritcodereview.com/ |
Ales Komarek | f93ac81 | 2016-08-31 19:37:43 +0200 | [diff] [blame] | 257 | * https://gerrit-review.googlesource.com/Documentation/ |
Ales Komarek | 7f93ce2 | 2016-08-29 23:27:47 +0200 | [diff] [blame] | 258 | * https://github.com/openstack-infra/puppet-gerrit/ |
| 259 | * https://gerrit-ci.gerritforge.com/ |
Ales Komarek | 1052676 | 2016-09-19 15:21:46 +0200 | [diff] [blame] | 260 | * https://github.com/morucci/exzuul |
Filip Pytloun | c5f3265 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 261 | |
| 262 | Documentation and Bugs |
| 263 | ====================== |
| 264 | |
| 265 | To learn how to install and update salt-formulas, consult the documentation |
| 266 | available online at: |
| 267 | |
| 268 | http://salt-formulas.readthedocs.io/ |
| 269 | |
| 270 | In the unfortunate event that bugs are discovered, they should be reported to |
| 271 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 272 | formula: |
| 273 | |
| 274 | https://github.com/salt-formulas/salt-formula-gerrit/issues |
| 275 | |
| 276 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 277 | use Launchpad salt-formulas project: |
| 278 | |
| 279 | https://launchpad.net/salt-formulas |
| 280 | |
| 281 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 282 | |
| 283 | https://launchpad.net/~salt-formulas-users |
| 284 | |
| 285 | Developers wishing to work on the salt-formulas projects should always base |
| 286 | their work on master branch and submit pull request against specific formula. |
| 287 | |
| 288 | https://github.com/salt-formulas/salt-formula-gerrit |
| 289 | |
| 290 | Any questions or feedback is always welcome so feel free to join our IRC |
| 291 | channel: |
| 292 | |
| 293 | #salt-formulas @ irc.freenode.net |