From b65406ba111d589423aef58e8096cb03ee78bd74 Mon Sep 17 00:00:00 2001 From: Ben Rohlfs <brohlfs@google.com> Date: Thu, 2 May 2019 10:43:40 +0200 Subject: [PATCH] Use $GERRIT_SITE var for referencing to gerrit_testsite Change 222679 tried to make this consistent by changing "sometimes ~/ and sometimes ../" to "always ~/", but ../ is the preferred way for developers and ~/ for the quick start. So let's use the $GERRIT_SITE variable everywhere instead and define it to ~/. The variable can easily be changed to ../. Change-Id: I2fc4ac8aa4374f25ed2679b85dcb17b80e8cffc4 --- Documentation/config-login-register.txt | 8 ++++---- Documentation/dev-readme.txt | 9 +++++---- Documentation/linux-quickstart.txt | 7 ++++--- polygerrit-ui/README.md | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Documentation/config-login-register.txt b/Documentation/config-login-register.txt index 3dcef0a603..cc2185b573 100644 --- a/Documentation/config-login-register.txt +++ b/Documentation/config-login-register.txt @@ -57,7 +57,7 @@ Open a browser and enter the canonical url of your Gerrit server. You can find the url in the settings file. ---- - gerrit@host:~$ git config -f ~/gerrit_testsite/etc/gerrit.config gerrit.canonicalWebUrl + gerrit@host:~$ git config -f $GERRIT_SITE/etc/gerrit.config gerrit.canonicalWebUrl http://localhost:8080/ gerrit@host:~$ ---- @@ -70,9 +70,9 @@ proxy, and you are using an external OpenID provider, you will need to add the proxy settings in the configuration file. ---- - gerrit@host:~$ git config -f ~/gerrit_testsite/etc/gerrit.config --add http.proxy http://proxy:8080 - gerrit@host:~$ git config -f ~/gerrit_testsite/etc/gerrit.config --add http.proxyUsername username - gerrit@host:~$ git config -f ~/gerrit_testsite/etc/gerrit.config --add http.proxyPassword password + gerrit@host:~$ git config -f $GERRIT_SITE/etc/gerrit.config --add http.proxy http://proxy:8080 + gerrit@host:~$ git config -f $GERRIT_SITE/etc/gerrit.config --add http.proxyUsername username + gerrit@host:~$ git config -f $GERRIT_SITE/etc/gerrit.config --add http.proxyPassword password ---- Refer to the Gerrit configuration guide for more detailed information about diff --git a/Documentation/dev-readme.txt b/Documentation/dev-readme.txt index d9cecce247..f9b09da718 100644 --- a/Documentation/dev-readme.txt +++ b/Documentation/dev-readme.txt @@ -53,8 +53,9 @@ After you compile the project <<compile_project,(above)>>, run the Gerrit command to create a test site: ---- + export GERRIT_SITE=~/gerrit_testsite $(bazel info output_base)/external/local_jdk/bin/java \ - -jar bazel-bin/gerrit.war init --batch --dev -d ../gerrit_testsite + -jar bazel-bin/gerrit.war init --batch --dev -d $GERRIT_SITE ---- [[special_bazel_java_version]] @@ -84,7 +85,7 @@ On the Start page, you can: To shut down the daemon, run: ---- - ~/gerrit_testsite/bin/gerrit.sh stop + $GERRIT_SITE/bin/gerrit.sh stop ---- @@ -135,7 +136,7 @@ copying to the test site: ---- $(bazel info output_base)/external/local_jdk/bin/java \ - -jar bazel-bin/gerrit.war daemon -d ~/gerrit_testsite \ + -jar bazel-bin/gerrit.war daemon -d $GERRIT_SITE \ --console-log ---- @@ -167,7 +168,7 @@ To start the Inspector, add the '-s' option to the daemon start command: ---- $(bazel info output_base)/external/local_jdk/bin/java \ - -jar bazel-bin/gerrit.war daemon -d ~/gerrit_testsite -s + -jar bazel-bin/gerrit.war daemon -d $GERRIT_SITE -s ---- NOTE: To learn why using `java -jar` isn't sufficient, see diff --git a/Documentation/linux-quickstart.txt b/Documentation/linux-quickstart.txt index bfebc6a2dd..c2dcedb5b3 100644 --- a/Documentation/linux-quickstart.txt +++ b/Documentation/linux-quickstart.txt @@ -43,7 +43,8 @@ link:dev-readme.html[Gerrit Code Review: Developer Setup]. From the command line, enter: .... -java -jar gerrit*.war init --batch --dev -d ~/gerrit_testsite +export GERRIT_SITE=~/gerrit_testsite +java -jar gerrit*.war init --batch --dev -d $GERRIT_SITE .... This command takes two parameters: @@ -78,7 +79,7 @@ To prevent outside connections from contacting your new Gerrit instance `localhost`. For example: .... -git config --file ~/gerrit_testsite/etc/gerrit.config httpd.listenUrl 'http://localhost:8080' +git config --file $GERRIT_SITE/etc/gerrit.config httpd.listenUrl 'http://localhost:8080' .... == Restart the Gerrit service @@ -87,7 +88,7 @@ You must restart the Gerrit service for your authentication type and listen URL changes to take effect: .... -~/gerrit_testsite/bin/gerrit.sh restart +$GERRIT_SITE/bin/gerrit.sh restart .... == Viewing Gerrit diff --git a/polygerrit-ui/README.md b/polygerrit-ui/README.md index ac299e50d9..c8c8e4f07f 100644 --- a/polygerrit-ui/README.md +++ b/polygerrit-ui/README.md @@ -96,7 +96,7 @@ directly from the sources in `polygerrit_ui/app/` instead of from the war: ```sh $(bazel info output_base)/external/local_jdk/bin/java \ -jar bazel-bin/gerrit.war daemon \ - -d ../gerrit_testsite \ + -d $GERRIT_SITE \ --console-log \ --polygerrit-dev ```