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 |
| 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 Komarek | 2fc3900 | 2016-09-14 11:43:56 +0200 | [diff] [blame] | 71 | |
| 72 | Gerrit 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 | |
Filip Pytloun | 33d84dd | 2016-12-20 16:13:24 +0100 | [diff] [blame^] | 85 | Gerrit client enforcing users, install using pip |
Ales Komarek | 2fc3900 | 2016-09-14 11:43:56 +0200 | [diff] [blame] | 86 | |
| 87 | .. code-block:: yaml |
| 88 | |
| 89 | gerrit: |
| 90 | client: |
Filip Pytloun | 33d84dd | 2016-12-20 16:13:24 +0100 | [diff] [blame^] | 91 | source: |
| 92 | engine: pip |
Ales Komarek | 2fc3900 | 2016-09-14 11:43:56 +0200 | [diff] [blame] | 93 | user: |
| 94 | jdoe: |
| 95 | fullname: John Doe |
| 96 | email: "jdoe@domain.com" |
| 97 | ssh_key: ssh-rsa |
| 98 | http_password: password |
| 99 | groups: |
| 100 | - Admin001 |
| 101 | |
| 102 | |
Ales Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 103 | Gerrit client enforcing projects |
| 104 | |
| 105 | .. code-block:: yaml |
| 106 | |
| 107 | gerrit: |
| 108 | client: |
| 109 | enabled: True |
| 110 | server: |
| 111 | host: 10.10.10.148 |
| 112 | user: newt |
| 113 | key: | |
| 114 | -----BEGIN RSA PRIVATE KEY----- |
| 115 | MIIEowIBAAKCAQEAs0Y8mxS3dfs5zG8Du5vdBkfOCOng1IEUmFZIirJ8oBgJOd54 |
| 116 | QgmkDFB7oP9eTCgz9k/rix1uJWhhVCMBzrWzH5IODO+tyy/tK66pv2BWtVfTDhBA |
| 117 | ... |
| 118 | l1UrxQKBgEklBTuEiDRibKGXQBwlAYvK2He09hWpqtpt9/DVel6s4A1bbTWDHyoP |
| 119 | jvMXms60iD/A5OpG33LWHNNzQBP486SxG75LB+Xs5sp5j2/b7VF5LJLhpGiJv9Mk |
| 120 | ydbuy8iuuvali2uF133kAlLqnrWfVTYQQI1OfW5glOv1L6kv94dU |
| 121 | -----END RSA PRIVATE KEY----- |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 122 | email: "Project Creator <infra@lists.domain.com>" |
Ales Komarek | 49a3729 | 2016-08-31 16:18:31 +0200 | [diff] [blame] | 123 | project: |
| 124 | test_salt_project: |
| 125 | enabled: true |
| 126 | |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 127 | Gerrit client enforcing project, full project example |
| 128 | |
| 129 | .. code-block:: yaml |
| 130 | |
| 131 | gerrit: |
| 132 | client: |
| 133 | enabled: True |
| 134 | project: |
| 135 | test_salt_project: |
| 136 | enabled: true |
| 137 | access: |
| 138 | "refs/heads/*": |
| 139 | actions: |
| 140 | - name: abandon |
| 141 | group: openstack-salt-core |
| 142 | - name: create |
| 143 | group: openstack-salt-release |
| 144 | labels: |
| 145 | - name: Code-Review |
| 146 | group: openstack-salt-core |
| 147 | score: -2..+2 |
| 148 | - name: Workflow |
| 149 | group: openstack-salt-core |
| 150 | score: -1..+1 |
| 151 | "refs/tags/*": |
| 152 | actions: |
| 153 | - name: pushSignedTag |
| 154 | group: openstack-salt-release |
| 155 | require_change_id: true |
| 156 | require_agreement: true |
| 157 | merge_content: true |
| 158 | |
Ales Komarek | 1acb14d | 2016-09-09 15:14:12 +0200 | [diff] [blame] | 159 | |
| 160 | .. code-block:: yaml |
| 161 | |
| 162 | gerrit: |
| 163 | client: |
| 164 | enabled: True |
| 165 | group: |
| 166 | groupname: |
| 167 | enabled: true |
| 168 | members: |
| 169 | - username |
| 170 | account: |
| 171 | username: |
| 172 | enabled: true |
| 173 | full_name: hovno |
| 174 | email: mail@newt.cz |
| 175 | public_key: rsassh |
| 176 | http_password: passwd |
| 177 | |
| 178 | |
Ales Komarek | 50c558e | 2016-09-05 23:34:43 +0200 | [diff] [blame] | 179 | Sample project access |
| 180 | |
| 181 | .. code-block:: yaml |
| 182 | |
| 183 | [access "refs/*"] |
| 184 | read = group Administrators |
| 185 | read = group Anonymous Users |
| 186 | [access "refs/for/refs/*"] |
| 187 | push = group Registered Users |
| 188 | pushMerge = group Registered Users |
| 189 | [access "refs/heads/*"] |
| 190 | create = group Administrators |
| 191 | create = group Project Owners |
| 192 | forgeAuthor = group Registered Users |
| 193 | forgeCommitter = group Administrators |
| 194 | forgeCommitter = group Project Owners |
| 195 | push = group Administrators |
| 196 | push = group Project Owners |
| 197 | label-Code-Review = -2..+2 group Administrators |
| 198 | label-Code-Review = -2..+2 group Project Owners |
| 199 | label-Code-Review = -1..+1 group Registered Users |
| 200 | label-Verified = -1..+1 group Non-Interactive Users |
| 201 | submit = group Administrators |
| 202 | submit = group Project Owners |
| 203 | editTopicName = +force group Administrators |
| 204 | editTopicName = +force group Project Owners |
| 205 | [access "refs/meta/config"] |
| 206 | exclusiveGroupPermissions = read |
| 207 | read = group Administrators |
| 208 | read = group Project Owners |
| 209 | push = group Administrators |
| 210 | push = group Project Owners |
| 211 | label-Code-Review = -2..+2 group Administrators |
| 212 | label-Code-Review = -2..+2 group Project Owners |
| 213 | submit = group Administrators |
| 214 | submit = group Project Owners |
| 215 | [access "refs/tags/*"] |
| 216 | pushTag = group Administrators |
| 217 | pushTag = group Project Owners |
| 218 | pushSignedTag = group Administrators |
| 219 | pushSignedTag = group Project Owners |
| 220 | [label "Code-Review"] |
| 221 | function = MaxWithBlock |
| 222 | copyMinScore = true |
| 223 | value = -2 This shall not be merged |
| 224 | value = -1 I would prefer this is not merged as is |
| 225 | value = 0 No score |
| 226 | value = +1 Looks good to me, but someone else must approve |
| 227 | value = +2 Looks good to me, approved |
| 228 | [label "Verified"] |
| 229 | function = MaxWithBlock |
| 230 | copyMinScore = true |
| 231 | value = -1 Fails |
| 232 | value = 0 No score |
| 233 | value = +1 Verified |
| 234 | |
Ales Komarek | 3446a0a | 2016-03-08 10:21:00 +0100 | [diff] [blame] | 235 | Read more |
| 236 | ========= |
| 237 | |
Ales Komarek | 7f93ce2 | 2016-08-29 23:27:47 +0200 | [diff] [blame] | 238 | * https://www.gerritcodereview.com/ |
Ales Komarek | f93ac81 | 2016-08-31 19:37:43 +0200 | [diff] [blame] | 239 | * https://gerrit-review.googlesource.com/Documentation/ |
Ales Komarek | 7f93ce2 | 2016-08-29 23:27:47 +0200 | [diff] [blame] | 240 | * https://github.com/openstack-infra/puppet-gerrit/ |
| 241 | * https://gerrit-ci.gerritforge.com/ |
Ales Komarek | 1052676 | 2016-09-19 15:21:46 +0200 | [diff] [blame] | 242 | * https://github.com/morucci/exzuul |