Search in sources :

Example 1 with LogConfigurator

use of com.thoughtworks.go.logging.LogConfigurator in project gocd by gocd.

the class DevelopmentServer method main.

public static void main(String[] args) throws Exception {
    LogConfigurator logConfigurator = new LogConfigurator(DEFAULT_LOGBACK_CONFIGURATION_FILE);
    logConfigurator.initialize();
    copyDbFiles();
    copyPluginAssets();
    File webApp = new File("webapp");
    if (!webApp.exists()) {
        throw new RuntimeException("No webapp found in " + webApp.getAbsolutePath());
    }
    assertActivationJarPresent();
    SystemEnvironment systemEnvironment = new SystemEnvironment();
    systemEnvironment.setProperty(GENERATE_STATISTICS, "true");
    systemEnvironment.setProperty(SystemEnvironment.PARENT_LOADER_PRIORITY, "true");
    systemEnvironment.setProperty(SystemEnvironment.CRUISE_SERVER_WAR_PROPERTY, webApp.getAbsolutePath());
    systemEnvironment.set(SystemEnvironment.PLUGIN_LOCATION_MONITOR_INTERVAL_IN_SECONDS, 5);
    systemEnvironment.set(SystemEnvironment.DEFAULT_PLUGINS_ZIP, "/plugins.zip");
    systemEnvironment.set(SystemEnvironment.PLUGIN_ACTIVATOR_JAR_PATH, "go-plugin-activator.jar");
    // 0 means reload when stale
    systemEnvironment.setProperty(GoConstants.I18N_CACHE_LIFE, "0");
    systemEnvironment.set(SystemEnvironment.GO_SERVER_MODE, "development");
    setupPeriodicGC(systemEnvironment);
    assertPluginsZipExists();
    GoServer server = new GoServer();
    systemEnvironment.setProperty(GoConstants.USE_COMPRESSED_JAVASCRIPT, Boolean.toString(false));
    try {
        server.startServer();
        String hostName = systemEnvironment.getListenHost();
        if (hostName == null) {
            hostName = "localhost";
        }
        System.out.println("Go server dashboard started on http://" + hostName + ":" + systemEnvironment.getServerPort());
        System.out.println("* credentials: \"admin\" / \"badger\"");
    } catch (Exception e) {
        System.err.println("Failed to start Go server. Exception:");
        e.printStackTrace();
    }
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) LogConfigurator(com.thoughtworks.go.logging.LogConfigurator) File(java.io.File) IOException(java.io.IOException)

Example 2 with LogConfigurator

use of com.thoughtworks.go.logging.LogConfigurator in project gocd by gocd.

the class AgentMain method main.

public static void main(String... argv) throws Exception {
    assertVMVersion();
    AgentBootstrapperArgs args = new AgentCLI().parse(argv);
    LogConfigurator logConfigurator = new LogConfigurator(DEFAULT_LOGBACK_CONFIGURATION_FILE);
    logConfigurator.initialize();
    new SystemEnvironment().setProperty("go.process.type", "agent");
    new SystemEnvironment().setProperty(SystemEnvironment.SERVICE_URL, args.getServerUrl().toString());
    new SystemEnvironment().setProperty(SystemEnvironment.AGENT_SSL_VERIFICATION_MODE, args.getSslMode().toString());
    if (args.getRootCertFile() != null) {
        new SystemEnvironment().setProperty(SystemEnvironment.AGENT_ROOT_CERT_FILE, args.getRootCertFile().toString());
    }
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
    ctx.registerShutdownHook();
}
Also used : AgentCLI(com.thoughtworks.go.agent.common.AgentCLI) SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) LogConfigurator(com.thoughtworks.go.logging.LogConfigurator) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) AgentBootstrapperArgs(com.thoughtworks.go.agent.common.AgentBootstrapperArgs)

Example 3 with LogConfigurator

use of com.thoughtworks.go.logging.LogConfigurator in project gocd by gocd.

the class AgentBootstrapper method main.

public static void main(String[] argv) {
    assertVMVersion();
    AgentBootstrapperArgs args = new AgentCLI().parse(argv);
    new LogConfigurator(DEFAULT_LOGBACK_CONFIGURATION_FILE).runWithLogger(() -> new AgentBootstrapper().go(true, args));
}
Also used : AgentCLI(com.thoughtworks.go.agent.common.AgentCLI) LogConfigurator(com.thoughtworks.go.logging.LogConfigurator) AgentBootstrapperArgs(com.thoughtworks.go.agent.common.AgentBootstrapperArgs)

Example 4 with LogConfigurator

use of com.thoughtworks.go.logging.LogConfigurator in project gocd by gocd.

the class AgentMacWindow method main.

public static void main(String[] args) throws IOException {
    LogConfigurator logConfigurator = new LogConfigurator(DEFAULT_LOGBACK_CONFIGURATION_FILE);
    logConfigurator.initialize();
    new AgentMacWindow().go();
}
Also used : LogConfigurator(com.thoughtworks.go.logging.LogConfigurator)

Example 5 with LogConfigurator

use of com.thoughtworks.go.logging.LogConfigurator in project gocd by gocd.

the class GoLauncher method main.

public static void main(String[] args) throws Exception {
    assertVMVersion();
    SystemEnvironment systemEnvironment = new SystemEnvironment();
    systemEnvironment.setProperty(GoConstants.USE_COMPRESSED_JAVASCRIPT, Boolean.toString(true));
    LogConfigurator logConfigurator = new LogConfigurator(DEFAULT_LOGBACK_CONFIGURATION_FILE);
    logConfigurator.initialize();
    try {
        cleanupTempFiles();
        new GoServer().go();
    } catch (Exception e) {
        System.err.println("ERROR: Failed to start Go server. Please check the logs.");
        e.printStackTrace();
        System.exit(1);
    }
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) LogConfigurator(com.thoughtworks.go.logging.LogConfigurator) GoServer(com.thoughtworks.go.server.GoServer)

Aggregations

LogConfigurator (com.thoughtworks.go.logging.LogConfigurator)5 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)3 AgentBootstrapperArgs (com.thoughtworks.go.agent.common.AgentBootstrapperArgs)2 AgentCLI (com.thoughtworks.go.agent.common.AgentCLI)2 GoServer (com.thoughtworks.go.server.GoServer)1 File (java.io.File)1 IOException (java.io.IOException)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1