Init: Optionally skip plugin installation process
That change fixes acceptance test execution from eclipse. Change-Id: I489578d06a670547ea42dbbe41e2057b490208cd
This commit is contained in:
@@ -84,7 +84,8 @@ class GerritServer {
|
|||||||
File tmp = TempFileUtil.createTempDirectory();
|
File tmp = TempFileUtil.createTempDirectory();
|
||||||
Init init = new Init();
|
Init init = new Init();
|
||||||
int rc = init.main(new String[] {
|
int rc = init.main(new String[] {
|
||||||
"-d", tmp.getPath(), "--batch", "--no-auto-start"});
|
"-d", tmp.getPath(), "--batch", "--no-auto-start",
|
||||||
|
"--skip-plugins"});
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
throw new RuntimeException("Couldn't initialize site");
|
throw new RuntimeException("Couldn't initialize site");
|
||||||
}
|
}
|
||||||
|
@@ -70,6 +70,9 @@ public class Init extends SiteProgram {
|
|||||||
@Option(name = "--no-auto-start", usage = "Don't automatically start daemon after init")
|
@Option(name = "--no-auto-start", usage = "Don't automatically start daemon after init")
|
||||||
private boolean noAutoStart;
|
private boolean noAutoStart;
|
||||||
|
|
||||||
|
@Option(name = "--skip-plugins", usage = "Don't install plugin")
|
||||||
|
private boolean skipPlugins = false;
|
||||||
|
|
||||||
@Option(name = "--list-plugins", usage = "List available plugins")
|
@Option(name = "--list-plugins", usage = "List available plugins")
|
||||||
private boolean listPlugins;
|
private boolean listPlugins;
|
||||||
|
|
||||||
@@ -90,6 +93,7 @@ public class Init extends SiteProgram {
|
|||||||
ErrorLogFile.errorOnlyConsole();
|
ErrorLogFile.errorOnlyConsole();
|
||||||
|
|
||||||
final SiteInit init = createSiteInit();
|
final SiteInit init = createSiteInit();
|
||||||
|
if (!skipPlugins) {
|
||||||
final List<PluginData> plugins = InitPlugins.listPlugins(init.site);
|
final List<PluginData> plugins = InitPlugins.listPlugins(init.site);
|
||||||
ConsoleUI ui = ConsoleUI.getInstance(false);
|
ConsoleUI ui = ConsoleUI.getInstance(false);
|
||||||
verifyInstallPluginList(ui, plugins);
|
verifyInstallPluginList(ui, plugins);
|
||||||
@@ -104,8 +108,10 @@ public class Init extends SiteProgram {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
init.flags.autoStart = !noAutoStart && init.site.isNew;
|
init.flags.autoStart = !noAutoStart && init.site.isNew;
|
||||||
|
init.flags.skipPlugins = skipPlugins;
|
||||||
|
|
||||||
final SiteRun run;
|
final SiteRun run;
|
||||||
try {
|
try {
|
||||||
|
@@ -34,10 +34,14 @@ public class InitFlags {
|
|||||||
/** Run the daemon (and open the web UI in a browser) after initialization. */
|
/** Run the daemon (and open the web UI in a browser) after initialization. */
|
||||||
public boolean autoStart;
|
public boolean autoStart;
|
||||||
|
|
||||||
|
/** Skip plugins */
|
||||||
|
public boolean skipPlugins;
|
||||||
|
|
||||||
public final FileBasedConfig cfg;
|
public final FileBasedConfig cfg;
|
||||||
public final FileBasedConfig sec;
|
public final FileBasedConfig sec;
|
||||||
public final List<String> installPlugins;
|
public final List<String> installPlugins;
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
InitFlags(final SitePaths site,
|
InitFlags(final SitePaths site,
|
||||||
final @InstallPlugins List<String> installPlugins) throws IOException,
|
final @InstallPlugins List<String> installPlugins) throws IOException,
|
||||||
|
@@ -75,6 +75,10 @@ public class SitePathInitializer {
|
|||||||
mkdir(site.data_dir);
|
mkdir(site.data_dir);
|
||||||
|
|
||||||
for (InitStep step : steps) {
|
for (InitStep step : steps) {
|
||||||
|
if (step instanceof InitPlugins
|
||||||
|
&& flags.skipPlugins) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
step.run();
|
step.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user