gerrit2@ronny:~$ java -jar gerrit-2.12.2.war -d review_site/
fatal: unknown command -d
(no com.google.gerrit.pgm.-d)
gerrit2@ronny:~$ java -jar gerrit-2.12.2.war -d review_site/
fatal: unknown command -d
(no com.google.gerrit.pgm.-d)
gerrit2@ronny:~$ java -jar gerrit-2.12.2.war init -d review_site/
Using secure store: com.google.gerrit.server.securestore.DefaultSecureStore
[2016-05-04 18:43:12,723] [main] INFO com.google.gerrit.server.config.GerritServerConfigProvider : No /home/gerrit2/review_site/etc/gerrit.config; assuming defaults
*** Gerrit Code Review 2.12.2
***
Create '/home/gerrit2/review_site' [Y/n]?
*** Git Repositories
***
Location of Git repositories [git]:
*** SQL Database
***
Database server type [h2]:
*** Index
***
Type [LUCENE/?]:
*** User Authentication
***
Authentication method [OPENID/?]: ?
Supported options are:
openid
openid_sso
http
http_ldap
client_ssl_cert_ldap
ldap
ldap_bind
custom_extension
development_become_any_account
oauth
Authentication method [OPENID/?]: development_become_any_account
Enable signed push support [y/N]?
*** Review Labels
***
Install Verified label [y/N]?
*** Email Delivery
***
SMTP server hostname [localhost]:
SMTP server port [(default)]:
SMTP encryption [NONE/?]:
SMTP username :
*** Container Process
***
Run as [gerrit2]:
Java runtime [/usr/lib/jvm/java-7-oracle/jre]:
Copy gerrit-2.12.2.war to review_site/bin/gerrit.war [Y/n]?
Copying gerrit-2.12.2.war to review_site/bin/gerrit.war
*** SSH Daemon
***
Listen on address [*]:
Listen on port [29418]:
Gerrit Code Review is not shipped with Bouncy Castle Crypto SSL v152
If available, Gerrit can take advantage of features
in the library, but will also function without it.
Download and install it now [Y/n]?
Downloading http://www.bouncycastle.org/download/bcpkix-jdk15on-152.jar ... Failed to clean up lib: review_site/lib/bcpkix-jdk15on-152.jar
!! FAIL !!
error: http://www.bouncycastle.org/download/bcpkix-jdk15on-152.jar: 302 Found
Please download:
http://www.bouncycastle.org/download/bcpkix-jdk15on-152.jar
and save as:
/home/gerrit2/review_site/lib/bcpkix-jdk15on-152.jar
Press enter to continue
Continue without this library [Y/n]?
Generating SSH host key ... rsa(simple)... done
*** HTTP Daemon
***
Behind reverse proxy [y/N]?
Use SSL (https://) [y/N]?
Listen on address [*]:
Listen on port [8080]: 8079
Canonical URL [http://ronny:8079/]:
*** Plugins
***
Installing plugins.
Install plugin singleusergroup version v2.12.2 [y/N]?
Install plugin commit-message-length-validator version v2.12.2 [y/N]?
Install plugin reviewnotes version v2.12.2 [y/N]?
Install plugin replication version v2.12.2 [y/N]?
Install plugin download-commands version v2.12.2 [y/N]?
Initializing plugins.
No plugins found with init steps.
*** Gerrit Administrator
***
Create administrator user [Y/n]?
username [admin]:
name [Administrator]:
HTTP password [secret]:
public SSH key file []:
email [admin@example.com]:
Initialized /home/gerrit2/review_site
Executing /home/gerrit2/review_site/bin/gerrit.sh start
Starting Gerrit Code Review: OK
Waiting for server on ronny:8079 ... OK
Opening http://ronny:8079/#/admin/projects/ ...No protocol specified
No protocol specified
OK
gerrit2@ronny:~$ ls
bcpkix-jdk15on-154 bcpkix-jdk15on-154.tar.gz examples.desktop gerrit-2.12.2.war review_site
gerrit2@ronny:~$ cd review_site/
gerrit2@ronny:~/review_site$ ls
bin cache data db etc git index lib logs plugins static tmp
gerrit2@ronny:~/review_site$ cd etc/
gerrit2@ronny:~/review_site/etc$ ls
gerrit.config mail secure.config ssh_host_key
gerrit2@ronny:~/review_site/etc$ cat gerrit.config
[gerrit]
basePath = git
canonicalWebUrl = http://ronny:8079/
[database]
type = h2
database = /home/gerrit2/review_site/db/ReviewDB
[index]
type = LUCENE
[auth]
type = DEVELOPMENT_BECOME_ANY_ACCOUNT
[receive]
enableSignedPush = false
[sendemail]
smtpServer = localhost
[container]
user = gerrit2
javaHome = /usr/lib/jvm/java-7-oracle/jre
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = http://*:8079/
[cache]
directory = cache
gerrit2@ronny:~/review_site/etc$
fatal: unknown command -d
(no com.google.gerrit.pgm.-d)
gerrit2@ronny:~$ java -jar gerrit-2.12.2.war -d review_site/
fatal: unknown command -d
(no com.google.gerrit.pgm.-d)
gerrit2@ronny:~$ java -jar gerrit-2.12.2.war init -d review_site/
Using secure store: com.google.gerrit.server.securestore.DefaultSecureStore
[2016-05-04 18:43:12,723] [main] INFO com.google.gerrit.server.config.GerritServerConfigProvider : No /home/gerrit2/review_site/etc/gerrit.config; assuming defaults
*** Gerrit Code Review 2.12.2
***
Create '/home/gerrit2/review_site' [Y/n]?
*** Git Repositories
***
Location of Git repositories [git]:
*** SQL Database
***
Database server type [h2]:
*** Index
***
Type [LUCENE/?]:
*** User Authentication
***
Authentication method [OPENID/?]: ?
Supported options are:
openid
openid_sso
http
http_ldap
client_ssl_cert_ldap
ldap
ldap_bind
custom_extension
development_become_any_account
oauth
Authentication method [OPENID/?]: development_become_any_account
Enable signed push support [y/N]?
*** Review Labels
***
Install Verified label [y/N]?
*** Email Delivery
***
SMTP server hostname [localhost]:
SMTP server port [(default)]:
SMTP encryption [NONE/?]:
SMTP username :
*** Container Process
***
Run as [gerrit2]:
Java runtime [/usr/lib/jvm/java-7-oracle/jre]:
Copy gerrit-2.12.2.war to review_site/bin/gerrit.war [Y/n]?
Copying gerrit-2.12.2.war to review_site/bin/gerrit.war
*** SSH Daemon
***
Listen on address [*]:
Listen on port [29418]:
Gerrit Code Review is not shipped with Bouncy Castle Crypto SSL v152
If available, Gerrit can take advantage of features
in the library, but will also function without it.
Download and install it now [Y/n]?
Downloading http://www.bouncycastle.org/download/bcpkix-jdk15on-152.jar ... Failed to clean up lib: review_site/lib/bcpkix-jdk15on-152.jar
!! FAIL !!
error: http://www.bouncycastle.org/download/bcpkix-jdk15on-152.jar: 302 Found
Please download:
http://www.bouncycastle.org/download/bcpkix-jdk15on-152.jar
and save as:
/home/gerrit2/review_site/lib/bcpkix-jdk15on-152.jar
Press enter to continue
Continue without this library [Y/n]?
Generating SSH host key ... rsa(simple)... done
*** HTTP Daemon
***
Behind reverse proxy [y/N]?
Use SSL (https://) [y/N]?
Listen on address [*]:
Listen on port [8080]: 8079
Canonical URL [http://ronny:8079/]:
*** Plugins
***
Installing plugins.
Install plugin singleusergroup version v2.12.2 [y/N]?
Install plugin commit-message-length-validator version v2.12.2 [y/N]?
Install plugin reviewnotes version v2.12.2 [y/N]?
Install plugin replication version v2.12.2 [y/N]?
Install plugin download-commands version v2.12.2 [y/N]?
Initializing plugins.
No plugins found with init steps.
*** Gerrit Administrator
***
Create administrator user [Y/n]?
username [admin]:
name [Administrator]:
HTTP password [secret]:
public SSH key file []:
email [admin@example.com]:
Initialized /home/gerrit2/review_site
Executing /home/gerrit2/review_site/bin/gerrit.sh start
Starting Gerrit Code Review: OK
Waiting for server on ronny:8079 ... OK
Opening http://ronny:8079/#/admin/projects/ ...No protocol specified
No protocol specified
OK
gerrit2@ronny:~$ ls
bcpkix-jdk15on-154 bcpkix-jdk15on-154.tar.gz examples.desktop gerrit-2.12.2.war review_site
gerrit2@ronny:~$ cd review_site/
gerrit2@ronny:~/review_site$ ls
bin cache data db etc git index lib logs plugins static tmp
gerrit2@ronny:~/review_site$ cd etc/
gerrit2@ronny:~/review_site/etc$ ls
gerrit.config mail secure.config ssh_host_key
gerrit2@ronny:~/review_site/etc$ cat gerrit.config
[gerrit]
basePath = git
canonicalWebUrl = http://ronny:8079/
[database]
type = h2
database = /home/gerrit2/review_site/db/ReviewDB
[index]
type = LUCENE
[auth]
type = DEVELOPMENT_BECOME_ANY_ACCOUNT
[receive]
enableSignedPush = false
[sendemail]
smtpServer = localhost
[container]
user = gerrit2
javaHome = /usr/lib/jvm/java-7-oracle/jre
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = http://*:8079/
[cache]
directory = cache
gerrit2@ronny:~/review_site/etc$
然后http://ronny:8079就可以访问gerrit的web界面了
进去点击become,