Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Init and start Gerrit in a single shell script example
#!/bin/sh -ex
SITE_PATH="${HOME}/site"
GERRIT_WAR="/path/to/gerrit.war"
# Because Gerrit's "daemon --init" can't take init options we will do this
# separately. Feature request filed:
# https://bugs.chromium.org/p/gerrit/issues/detail?id=9004
# Init site (provision). Note that the GERRIT_WAR may be a different version
# than the one in "${SITE_PATH}/bin/gerrit.war".
java ${JAVA_OPTIONS} -jar ${GERRIT_WAR} init \
--site-path "${SITE_PATH}" \
--batch \
--no-auto-start \
--install-all-plugins \
--skip-all-downloads
# Run daemon in foreground with 'exec' to pass signals.
exec java ${JAVA_OPTIONS} -jar "${SITE_PATH}/bin/gerrit.war" daemon \
--site-path "${SITE_PATH}" \
--console-log \
$@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.