Gitiles Install Howto

I sucked a bit with Gitiles, Gerrit’s Gitweb implementation, because this project lacks an INSTALL file.

So, basically you have to do following:

  • First, check out of the source:

    git clone https://gerrit.googlesource.com/gitiles

  • After you cloned the source, compile it with Maven:

    mvn package -Dmaven.test.skip=true

Now, you got gitiles-war-1.0-SNAPSHOT.war in gitiles-war/target folder. Deploy it under your application server, in this case I put it to Jetty’s webapps folder.

  • Tricky part is coming: you will faced with an error message, what says some configuration options are missing. This is because you didn’t created any configuration file yet. By default, webapp searches its configuration in the webapp root folder, but - because jetty explodes this folder every restart, I decided to put it to some more persistent place. I am do not run any other thing under this Jetty than Gerrit and Gitiles, so I created the gitiles.config under Jetty’s etc folder:
gitiles.config
1
2
3
4
5
6
7
8
9
10
11
[gitiles]
    # Repositories placed here
    basePath = /srv/git/repositories
    # Do not check they are exported
    exportAll = true
    # This URL will be displayed as clone URL. DO NOT FORGET TRAILING SLASH!
    baseGitUrl = ssh://cr.hron.me:29418/
    # Title of site (doh)
    siteTitle  = Gitiles - kingmax.hron.me:/srv/git/repositories
    # I dunno why, but it is have to be configured.
    canonicalHostName = kingmax.hron.me
  • The config file above is cool, but Gitiles still crying… yeah, because you have to tell where it should find that. To do this, you must export a System property com.google.gitiles.configPath. I was very lazy, so I edited jetty.xml and before last closing tag I pasted this:
jetty.xml
1
2
3
4
<Call class="java.lang.System" name="setProperty">
    <Arg>com.google.gitiles.configPath</Arg>
    <Arg><SystemProperty name="jetty.home" default="." />/etc/gitiles.config</Arg>
</Call>

Comments