7. Gerrit Integrated Gitweb

Source: Internet
Author: User

Introduction to local integration of Gerrit and Gitweb

Gerrit is able to manage and generate hyperlinks to Gitweb, and allows users to view the same information from the Gerrit page to the Gitweb page.

The following is an introduction to the Gerrit-gitweb integration of the Gerrit website:

Https://gerrit-documentation.storage.googleapis.com/Documentation/2.7/config-gitweb.html


How are Gerrit and Gitweb integrated?

1, first Gerrit on the server to install Gitweb, if not installed, execute the following command to install

Yum-y Install Gitweb


2, configure Gerrit to integrate Gitweb

Configuration command:

git config--file $site _path/etc/gerrit.config gitweb.cgi $gitweb _path/gitweb.cgi
git config--file $site _path/etc/gerrit.config--unset gitweb.url
In my test environment, the installation path for Gerrit is/home/gerrit2/gerrit

Yum installed Gitweb, the generated gitweb.cgi file path is/var/www/git/gitweb.cgi

650) this.width=650, "class=" Confluence-embedded-image "title=" Research > 8, Gerrit, Gitweb integration > image2016-6-14 14:27:57.png "width=" "src=" http://wiki.cheyaoshicorp.com/download/attachments/11012107/image2016-6-14%2014% 3a27%3a57.png?version=1&modificationdate=1465886086000&api=v2 "alt=" Image2016-6-14%2014%3a27%3a57.png? Versio "/>

Restart the Gerrit server after installation is complete


After rebooting, you can see the hyperlinks of Gitweb

650) this.width=650, "class=" Confluence-embedded-image "title=" Research > 8, Gerrit, Gitweb integration > image2016-6-14 14:32:25.png "width=" "src=" http://wiki.cheyaoshicorp.com/download/attachments/11012107/image2016-6-14%2014% 3a32%3a25.png?version=1&modificationdate=1465886086000&api=v2 "alt=" Image2016-6-14%2014%3a32%3a25.png? Versio "/>

Opens the hyperlink, which is visible to all submission records for the project, and to what is modified each time it is submitted.

650) this.width=650, "class=" Confluence-embedded-image "title=" Research > 8, Gerrit, Gitweb integration > image2016-6-14 14:32:53.png "width=" "src=" http://wiki.cheyaoshicorp.com/download/attachments/11012107/image2016-6-14%2014% 3a32%3a53.png?version=1&modificationdate=1465886086000&api=v2 "alt=" Image2016-6-14%2014%3a32%3a53.png? Versio "/>

650) this.width=650, "class=" Confluence-embedded-image "title=" Research > 8, Gerrit, Gitweb integration > image2016-6-14 14:35:59.png "width=" "src=" http://wiki.cheyaoshicorp.com/download/attachments/11012107/image2016-6-14%2014% 3a35%3a59.png?version=1&modificationdate=1465886160000&api=v2 "alt=" Image2016-6-14%2014%3a35%3a59.png? Versio "/>


Gitweb Permissions Issues

Gitweb integrated Gerrit, the default is only for administrator users to view gitweb hyperlinks, the normal use of open links after the page display not Found.

If you want to give normal users permission to view Gitweb hyperlinks, you must set refs/meta/config Read permission on the project. This privilege is only open to administrators users and project owners in All-projects ACLs.

650) this.width=650; "class=" Confluence-embedded-image "title=" Research > 8, Gerrit, Gitweb integration > Image2016-6-16 8:53:9. PNG "width=" "src=" http://wiki.cheyaoshicorp.com/download/attachments/11012107/image2016-6-16%208%3A53% 3a9.png?version=1&modificationdate=1466038389000&api=v2 "alt=" image2016-6-16%208%3a53%3a9.png?version= " />


It is necessary to add Read permissions to the Refs/meta/config for the project's user group in the ACL of the individual project, as

650) this.width=650, "class=" Confluence-embedded-image "title=" Research > 8, Gerrit, Gitweb integration > image2016-6-16 8:56:41.png "width=" "src=" http://wiki.cheyaoshicorp.com/download/attachments/11012107/image2016-6-16%208% 3a56%3a41.png?version=1&modificationdate=1466038601000&api=v2 "alt=" Image2016-6-16%208%3a56%3a41.png? Version "/>

Here I am open to all registered users of this permission, with the normal user User2 login Gerrit Web UI, can actually open the Ci-demo project inside the Gitweb hyperlink

650) this.width=650, "class=" Confluence-embedded-image "title=" Research > 8, Gerrit, Gitweb integration > image2016-6-16 8:58:27.png "width=" "src=" http://wiki.cheyaoshicorp.com/download/attachments/11012107/image2016-6-16%208% 3a58%3a27.png?version=1&modificationdate=1466038707000&api=v2 "alt=" Image2016-6-16%208%3a58%3a27.png? Version "/>


But here's the problem. The original Gerrit is to use Git to do its own ACL management, so all users who have Read permission to Refs/meta/config can modify the permissions in the access page of project, although the modification cannot be directly submit, However, review can be submitted as a patch. And through Gitweb can see the project.config and groups files of the entire content, know how the current project is to set permissions. If that's the right thing to benevolent see.

650) this.width=650, "class=" Confluence-embedded-image "title=" Research > 8, Gerrit, Gitweb integration > image2016-6-16 8:59:50.png "width=" "src=" http://wiki.cheyaoshicorp.com/download/attachments/11012107/image2016-6-16%208% 3a59%3a50.png?version=1&modificationdate=1466038790000&api=v2 "alt=" Image2016-6-16%208%3a59%3a50.png? Version "/>


In addition, for user-submitted patches on permissions modification, if you want to commit, you need to refs/meta/config do and refs/heads/* the same permission settings, also said to need a Label Code-review,label verified, A commit patch is only possible with three permissions.

650) this.width=650; "class=" Confluence-embedded-image "title=" Research > 8, Gerrit, Gitweb integration > Image2016-6-16 9:11:7. PNG "width=" "src=" http://wiki.cheyaoshicorp.com/download/attachments/11012107/image2016-6-16%209%3A11% 3a7.png?version=1&modificationdate=1466039467000&api=v2 "alt=" image2016-6-16%209%3a11%3a7.png?version= " />









This article from "Zengestudy" blog, declined reprint!

7. Gerrit Integrated Gitweb

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.