Skip to content

Instantly share code, notes, and snippets.

@gertvdijk
Created July 27, 2018 11:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gertvdijk/9790e0d42e9f6a539703d6e60e0ff7fd to your computer and use it in GitHub Desktop.
Save gertvdijk/9790e0d42e9f6a539703d6e60e0ff7fd to your computer and use it in GitHub Desktop.
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