Allow use server.go for testing against local site

Gerrit had 2 different ways to serve files locally:
- start server.go web server
- start gerrit binary with --polygerrit-dev flag

Both implementations did the same handling for local files.

This change removes --polygerrit-dev flag and related java
implementation and instead a new option --dev-cdn is added.
This option enables using cdn for static content.

Change-Id: I40d4c6c048de018bc6d856c889d7ec59592282ed
This commit is contained in:
Dmitrii Filippov
2020-02-11 17:12:14 +01:00
parent b0876e8aa3
commit f363ad89ae
10 changed files with 57 additions and 335 deletions

View File

@@ -17,12 +17,12 @@ package com.google.gerrit.server.config;
public class GerritOptions {
private final boolean headless;
private final boolean slave;
private final boolean forcePolyGerritDev;
private final String devCdn;
public GerritOptions(boolean headless, boolean slave, boolean forcePolyGerritDev) {
public GerritOptions(boolean headless, boolean slave, String devCdn) {
this.headless = headless;
this.slave = slave;
this.forcePolyGerritDev = forcePolyGerritDev;
this.devCdn = devCdn;
}
public boolean headless() {
@@ -33,7 +33,11 @@ public class GerritOptions {
return !slave;
}
public boolean forcePolyGerritDev() {
return !headless && forcePolyGerritDev;
public String devCdn() {
return devCdn;
}
public boolean useDevCdn() {
return !headless && devCdn.length() > 0;
}
}