Search in sources :

Example 1 with PluginDownloader

use of org.jenkinsci.test.acceptance.resolver.PluginDownloader in project acceptance-test-harness by jenkinsci.

the class RemoteJenkinsProvider method createNewJenkinsController.

private JenkinsController createNewJenkinsController() {
    Machine machine = machineProvider.get();
    try {
        // install jenkins WAR
        jenkinsResolver.materialize(machine, jenkinsWar);
    } catch (Exception e) {
        logger.error("Error during setting up Jenkins: " + e.getMessage(), e);
        throw new AssertionError(e);
    }
    String jenkinsHome = machine.dir() + newJenkinsHome() + "/";
    String pluginDir = jenkinsHome + "plugins/";
    String path = JenkinsResolver.JENKINS_TEMP_DIR + "form-element-path.hpi";
    // install form-path-element plugin
    new PluginDownloader("form-element-path").materialize(machine, path);
    try (Ssh ssh = machine.connect()) {
        ssh.executeRemoteCommand("mkdir -p " + pluginDir);
        ssh.executeRemoteCommand(String.format("cp %s %s", path, pluginDir));
    }
    return new RemoteJenkinsController(injector, machine, jenkinsHome, jenkinsWar, privateKeyFile);
}
Also used : PluginDownloader(org.jenkinsci.test.acceptance.resolver.PluginDownloader) Ssh(org.jenkinsci.test.acceptance.Ssh) RemoteJenkinsController(org.jenkinsci.test.acceptance.controller.RemoteJenkinsController) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 Ssh (org.jenkinsci.test.acceptance.Ssh)1 RemoteJenkinsController (org.jenkinsci.test.acceptance.controller.RemoteJenkinsController)1 PluginDownloader (org.jenkinsci.test.acceptance.resolver.PluginDownloader)1