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
This commit is contained in:
Ben Rohlfs 2019-05-02 10:43:40 +02:00
parent 4d125505c6
commit b65406ba11
4 changed files with 14 additions and 12 deletions

@ -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. 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/ http://localhost:8080/
gerrit@host:~$ 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. 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_SITE/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_SITE/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.proxyPassword password
---- ----
Refer to the Gerrit configuration guide for more detailed information about Refer to the Gerrit configuration guide for more detailed information about

@ -53,8 +53,9 @@ After you compile the project <<compile_project,(above)>>, run the Gerrit
command to create a test site: command to create a test site:
---- ----
export GERRIT_SITE=~/gerrit_testsite
$(bazel info output_base)/external/local_jdk/bin/java \ $(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]] [[special_bazel_java_version]]
@ -84,7 +85,7 @@ On the Start page, you can:
To shut down the daemon, run: 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 \ $(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 --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 \ $(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 NOTE: To learn why using `java -jar` isn't sufficient, see

@ -43,7 +43,8 @@ link:dev-readme.html[Gerrit Code Review: Developer Setup].
From the command line, enter: 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: This command takes two parameters:
@ -78,7 +79,7 @@ To prevent outside connections from contacting your new Gerrit instance
`localhost`. For example: `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 == 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: changes to take effect:
.... ....
~/gerrit_testsite/bin/gerrit.sh restart $GERRIT_SITE/bin/gerrit.sh restart
.... ....
== Viewing Gerrit == Viewing Gerrit

@ -96,7 +96,7 @@ directly from the sources in `polygerrit_ui/app/` instead of from the war:
```sh ```sh
$(bazel info output_base)/external/local_jdk/bin/java \ $(bazel info output_base)/external/local_jdk/bin/java \
-jar bazel-bin/gerrit.war daemon \ -jar bazel-bin/gerrit.war daemon \
-d ../gerrit_testsite \ -d $GERRIT_SITE \
--console-log \ --console-log \
--polygerrit-dev --polygerrit-dev
``` ```