openfrontier / docker-gerrit

Build a Docker image with the Gerrit code review system
Apache License 2.0
197 stars 116 forks source link

Can not restart the gerrit server without data lost when gerrit.conf is modified! #15

Closed databill closed 8 years ago

databill commented 8 years ago

Thanks for the easily set-up gerrit container. I have used it for months.

There is description(https://gerrit-review.googlesource.com/#/c/49820/) that modification in secure.conf will be auto-loaded , but modification in gerrit.conf requires to restart gerrit server. In the container, I can not use _gerrit.sh restart_ to restart the server or when I use docker cli to restart the container, the container will be re-initialized and all the content in the container will be lost.

I use a parameter to map the gerrit main path( -v /work/repo:/home/gerrit/gerrit/git ), so I can modify the config file outside the container easily. Now it is required to integrate gerrit server with Jira, and I have to modify the gerrit.conf to add commentLink information.

[commentLink "its-jira"]
    match = JIRA-(\\[[1-9][0-9]*\\])
    html = "<a href=\"http://jira-server/$1\">$1</a>"
    association = SUGGESTED

That is because use daemon in the cli or started by gosu?

exec gosu ${GERRIT_USER} $GERRIT_SITE/bin/gerrit.sh daemon
thinkernel commented 8 years ago

Hi there. I'm sorry for the late response. I was trapped in a business trip last few weeks. About your issue, as I mentioned in the README that you may mount the gerrit site storage to the local directory by using -v ~/gerrit_volume:/var/gerrit/review_site. Then you can modify the gerrit.conf and restart the gerrit docker container by using docker restart command.