本文整理汇总了Java中hudson.slaves.JNLPLauncher类的典型用法代码示例。如果您正苦于以下问题:Java JNLPLauncher类的具体用法?Java JNLPLauncher怎么用?Java JNLPLauncher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JNLPLauncher类属于hudson.slaves包,在下文中一共展示了JNLPLauncher类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: should_connect_agent
import hudson.slaves.JNLPLauncher; //导入依赖的package包/类
@Test
public void should_connect_agent() throws InterruptedException, ExecutionException, IOException, URISyntaxException {
final JenkinsLocationConfiguration location = JenkinsLocationConfiguration.get();
URI uri = URI.create(location.getUrl());
if (SystemUtils.IS_OS_MAC) {
uri = new URI(uri.getScheme(), uri.getUserInfo(), "docker.for.mac.localhost",
uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment());
} else if (SystemUtils.IS_OS_WINDOWS) {
uri = new URI(uri.getScheme(), uri.getUserInfo(), "docker.for.windows.localhost",
uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment());
}
final DockerTemplate template = new DockerTemplate(
new DockerTemplateBase("jenkins/jnlp-slave"),
new DockerComputerJNLPConnector(new JNLPLauncher(null, null)).withUser("jenkins")
.withJenkinsUrl(uri.toString()),
"docker-agent", "/home/jenkins/agent", "10"
);
if (SystemUtils.IS_OS_LINUX) {
template.getDockerTemplateBase().setNetwork("host");
}
should_connect_agent(template);
}
开发者ID:jenkinsci,项目名称:docker-plugin,代码行数:27,代码来源:DockerComputerJNLPConnectorTest.java
示例2: isLaunchSupported
import hudson.slaves.JNLPLauncher; //导入依赖的package包/类
@Override
public boolean isLaunchSupported() {
//TODO: Add this into the settings for node setup
boolean overrideLaunchSupported = delegate.isLaunchSupported();
//Support launching for the JNLPLauncher, so the `launch` function gets called
//and the VM can be reset to a snapshot.
if (delegate instanceof JNLPLauncher) {
overrideLaunchSupported = true;
}
return overrideLaunchSupported;
}
开发者ID:justnom,项目名称:proxmox-plugin,代码行数:12,代码来源:VirtualMachineLauncher.java
示例3: call
import hudson.slaves.JNLPLauncher; //导入依赖的package包/类
public Node call() throws Exception {
ECSSlave slave = new ECSSlave(ECSCloud.this, name + "-" + UUID.randomUUID().toString(), template.getRemoteFSRoot(), label == null ? null: label.toString(), new JNLPLauncher());
Jenkins.getInstance().addNode(slave);
LOGGER.log(Level.INFO, "Created Slave: {0}", slave.getNodeName());
Collection<String> command = getDockerRunCommand(slave);
final RegisterTaskDefinitionRequest req = template.asRegisterTaskDefinitionRequest(command);
final AmazonECSClient client = new AmazonECSClient(getCredentials(credentialsId));
final RegisterTaskDefinitionResult result = client.registerTaskDefinition(req);
String definitionArn = result.getTaskDefinition().getTaskDefinitionArn();
LOGGER.log(Level.FINE, "Slave {0} - Created Task Definition {1}: {2}", new Object[] { slave.getNodeName(), definitionArn, req });
LOGGER.log(Level.INFO, "Slave {0} - Created Task Definition: {1}", new Object[] { slave.getNodeName(), definitionArn });
slave.setTaskDefinitonArn(definitionArn);
final RunTaskResult runTaskResult = client.runTask(new RunTaskRequest()
.withTaskDefinition(definitionArn)
.withCluster(cluster)
);
if (! runTaskResult.getFailures().isEmpty()) {
for (Failure failure : runTaskResult.getFailures()) {
LOGGER.log(Level.WARNING, "Slave {0} - {1} : {2}", new Object[] { slave.getNodeName(), failure.getReason(), failure.getArn() });
}
throw new IOException("Failed to run slave container " + slave.getNodeName());
}
String taskArn = runTaskResult.getTasks().get(0).getTaskArn();
LOGGER.log(Level.INFO, "Slave {0} - Slave Task Started : {1}", new Object[] {slave.getNodeName(), taskArn});
slave.setTaskArn(taskArn);
int i = 0;
int j = 100; // wait 100 seconds
// now wait for slave to be online
for (; i < j; i++) {
if (slave.getComputer() == null) {
throw new IllegalStateException("Slave " + slave.getNodeName() + " - Node was deleted, computer is null");
}
if (slave.getComputer().isOnline()) {
break;
}
LOGGER.log(Level.FINE, "Waiting for slave {0} to connect ({2}/{3}): {1}", new Object[] { slave.getNodeName(), taskArn, i, j});
Thread.sleep(1000);
}
if (!slave.getComputer().isOnline()) {
throw new IllegalStateException("ECS Slave " + slave.getNodeName() + "is not connected after " + j + " seconds");
}
LOGGER.log(Level.INFO, "ECS Slave " + slave.getNodeName() + " connected: {0}", taskArn);
return slave;
}
开发者ID:cloudbees,项目名称:amazon-ecs-plugin,代码行数:54,代码来源:ECSCloud.java
示例4: DockerLauncher
import hudson.slaves.JNLPLauncher; //导入依赖的package包/类
@DataBoundConstructor
public DockerLauncher(String execUser) {
super(new JNLPLauncher());
this.execUser = execUser;
}
开发者ID:kmbulebu,项目名称:docker-ephemeral-cloud,代码行数:6,代码来源:DockerLauncher.java
示例5: createLinuxSlave
import hudson.slaves.JNLPLauncher; //导入依赖的package包/类
private Slave createLinuxSlave(String name, String description, String label) throws Exception {
return new DumbSlave(name, description, "/wherever", "1", Node.Mode.NORMAL, label, new JNLPLauncher(), RetentionStrategy.NOOP, Collections.<NodeProperty<?>>emptyList());
}
开发者ID:v1v,项目名称:jenkinslint-plugin,代码行数:4,代码来源:WindowsSlaveLaunchCheckerTestCase.java
示例6: createSlave
import hudson.slaves.JNLPLauncher; //导入依赖的package包/类
private Slave createSlave(String name, String description, String label) throws Exception {
return new DumbSlave(name, description, "/wherever", "1", Node.Mode.NORMAL, label, new JNLPLauncher(), RetentionStrategy.NOOP, Collections.<NodeProperty<?>>emptyList());
}
开发者ID:v1v,项目名称:jenkinslint-plugin,代码行数:4,代码来源:SlaveVersionCheckerTestCase.java
示例7: createSlave
import hudson.slaves.JNLPLauncher; //导入依赖的package包/类
private Slave createSlave(String name, String description) throws Exception {
return new DumbSlave(name, description, "/wherever", "1", Node.Mode.NORMAL, null, new JNLPLauncher(), RetentionStrategy.NOOP, Collections.<NodeProperty<?>>emptyList());
}
开发者ID:v1v,项目名称:jenkinslint-plugin,代码行数:4,代码来源:SlaveDescriptionCheckerTestCase.java
示例8: getLauncher
import hudson.slaves.JNLPLauncher; //导入依赖的package包/类
@Override
public ComputerLauncher getLauncher() {
return new JNLPLauncher();
}
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:5,代码来源:DockerComputerJNLPLauncher.java
示例9: getJNLPLauncher
import hudson.slaves.JNLPLauncher; //导入依赖的package包/类
public Class getJNLPLauncher() {
return JNLPLauncher.class;
}
开发者ID:KostyaSha,项目名称:yet-another-docker-plugin,代码行数:4,代码来源:DockerComputerJNLPLauncher.java
示例10: DockerComputerJNLPConnector
import hudson.slaves.JNLPLauncher; //导入依赖的package包/类
@DataBoundConstructor
public DockerComputerJNLPConnector(JNLPLauncher jnlpLauncher) {
this.jnlpLauncher = jnlpLauncher;
}
开发者ID:jenkinsci,项目名称:docker-plugin,代码行数:5,代码来源:DockerComputerJNLPConnector.java
示例11: getJnlpLauncher
import hudson.slaves.JNLPLauncher; //导入依赖的package包/类
public JNLPLauncher getJnlpLauncher() {
return jnlpLauncher;
}
开发者ID:jenkinsci,项目名称:docker-plugin,代码行数:4,代码来源:DockerComputerJNLPConnector.java
示例12: createLauncher
import hudson.slaves.JNLPLauncher; //导入依赖的package包/类
@Override
protected ComputerLauncher createLauncher(final DockerAPI api, final String workdir, final InspectContainerResponse inspect, TaskListener listener) throws IOException, InterruptedException {
return new JNLPLauncher();
}
开发者ID:jenkinsci,项目名称:docker-plugin,代码行数:5,代码来源:DockerComputerJNLPConnector.java
注:本文中的hudson.slaves.JNLPLauncher类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论