parent
ae3941707a
commit
c8b85b882d
4 changed files with 44 additions and 12 deletions
|
|
@ -57,6 +57,10 @@ task buildImage(type: Exec) {
|
|||
task tagLatestImage(type: Exec) {
|
||||
dependsOn buildImage
|
||||
|
||||
enabled = !project.version.contains("SNAPSHOT")
|
||||
&& !project.version.contains("alpha") \
|
||||
&& !project.version.contains("beta") \
|
||||
|
||||
commandLine 'podman', 'tag', "${project.name}:${project.version}",\
|
||||
"${project.name}:latest"
|
||||
}
|
||||
|
|
@ -78,20 +82,30 @@ task pushImage(type: Exec) {
|
|||
task pushLatestImage(type: Exec) {
|
||||
dependsOn buildLatestImage
|
||||
|
||||
enabled = !project.version.contains("SNAPSHOT")
|
||||
&& !project.version.contains("alpha") \
|
||||
&& !project.version.contains("beta") \
|
||||
|
||||
commandLine 'podman', 'push', '--tls-verify=false', \
|
||||
"localhost/${project.name}:${project.version}", \
|
||||
"${project.rootProject.properties['docker.registry']}" \
|
||||
+ "/${project.name}:latest"
|
||||
}
|
||||
|
||||
task pushForTest {
|
||||
dependsOn pushImage
|
||||
dependsOn pushLatestImage
|
||||
task pushForTest(type: Exec) {
|
||||
dependsOn buildImage
|
||||
|
||||
commandLine 'podman', 'push', '--tls-verify=false', \
|
||||
"localhost/${project.name}:${project.version}", \
|
||||
"${project.rootProject.properties['docker.registry']}" \
|
||||
+ "/${project.name}:test"
|
||||
}
|
||||
|
||||
task pushImages {
|
||||
// Don't push without testing first
|
||||
dependsOn test
|
||||
dependsOn pushForTest
|
||||
dependsOn pushImage
|
||||
dependsOn pushLatestImage
|
||||
}
|
||||
|
||||
test {
|
||||
|
|
|
|||
|
|
@ -1,21 +1,20 @@
|
|||
package org.jdrupes.vmoperator.manager;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import io.fabric8.kubernetes.client.Config;
|
||||
import io.fabric8.kubernetes.client.KubernetesClient;
|
||||
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
|
||||
import io.fabric8.kubernetes.client.dsl.base.ResourceDefinitionContext;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Map;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.yaml.snakeyaml.LoaderOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.constructor.SafeConstructor;
|
||||
import io.fabric8.kubernetes.client.KubernetesClient;
|
||||
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
|
||||
import io.fabric8.kubernetes.client.dsl.base.ResourceDefinitionContext;
|
||||
import io.fabric8.kubernetes.client.Config;
|
||||
|
||||
class BasicTests {
|
||||
|
||||
|
|
@ -41,7 +40,7 @@ class BasicTests {
|
|||
.inNamespace("vmop-dev");
|
||||
resourcesInNamespace.withName("unittest-vm").delete();
|
||||
|
||||
// Update pod by scaling deployment
|
||||
// Update manager pod by scaling deployment
|
||||
client.apps().deployments().inNamespace("vmop-dev")
|
||||
.withName("vm-operator").scale(0);
|
||||
client.apps().deployments().inNamespace("vmop-dev")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue