Search in sources :

Example 1 with AgentCLI

use of com.thoughtworks.go.agent.common.AgentCLI 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 2 with AgentCLI

use of com.thoughtworks.go.agent.common.AgentCLI 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)

Aggregations

AgentBootstrapperArgs (com.thoughtworks.go.agent.common.AgentBootstrapperArgs)2 AgentCLI (com.thoughtworks.go.agent.common.AgentCLI)2 LogConfigurator (com.thoughtworks.go.logging.LogConfigurator)2 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1