use of com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy in project configuration-as-code-plugin by jenkinsci.
the class DockerCloudTest method configure_docker_cloud.
@Test
@ConfiguredWithReadme("docker/README.md")
public void configure_docker_cloud() {
final DockerCloud docker = DockerCloud.getCloudByName("docker");
assertNotNull(docker);
assertNotNull(docker.getDockerApi());
assertNotNull(docker.getDockerApi().getDockerHost());
assertEquals("unix:///var/run/docker.sock", docker.getDockerApi().getDockerHost().getUri());
final DockerTemplate template = docker.getTemplate("jenkins/agent");
checkTemplate(template, "docker-agent", "jenkins", "/home/jenkins/agent", "10", new String[] { "hello:/hello", "world:/world" }, "hello=world\nfoo=bar");
assertTrue(template.getRetentionStrategy() instanceof DockerOnceRetentionStrategy);
assertEquals(1, ((DockerOnceRetentionStrategy) template.getRetentionStrategy()).getIdleMinutes());
}
Aggregations