Search in sources :

Example 31 with BuildBuilder

use of io.strimzi.api.kafka.model.connect.build.BuildBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaConnectDockerfileTest method testChecksumZipArtifact.

@ParallelTest
public void testChecksumZipArtifact() {
    Build connectBuild = new BuildBuilder().withPlugins(new PluginBuilder().withName("my-connector-plugin").withArtifacts(zipArtifactWithChecksum).build()).build();
    KafkaConnectDockerfile df = new KafkaConnectDockerfile("myImage:latest", connectBuild);
    assertThat(df.getDockerfile(), isEquivalent("FROM myImage:latest", "USER root:root", "RUN 'mkdir' '-p' '/opt/kafka/plugins/my-connector-plugin/90e04094' \\", "      && 'curl' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip' 'https://mydomain.tld/my2.zip' \\", "      && 'echo' 'sha-512-checksum /opt/kafka/plugins/my-connector-plugin/90e04094.zip' > '/opt/kafka/plugins/my-connector-plugin/90e04094.zip.sha512' \\", "      && 'sha512sum' '--check' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip.sha512' \\", "      && 'rm' '-f' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip.sha512' \\", "      && 'unzip' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip' '-d' '/opt/kafka/plugins/my-connector-plugin/90e04094' \\", "      && 'find' '/opt/kafka/plugins/my-connector-plugin/90e04094' '-type' 'l' | 'xargs' 'rm' '-f' \\", "      && 'rm' '-vf' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip'", "USER 1001"));
}
Also used : Build(io.strimzi.api.kafka.model.connect.build.Build) PluginBuilder(io.strimzi.api.kafka.model.connect.build.PluginBuilder) BuildBuilder(io.strimzi.api.kafka.model.connect.build.BuildBuilder) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 32 with BuildBuilder

use of io.strimzi.api.kafka.model.connect.build.BuildBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaConnectDockerfileTest method testMultipleZipArtifact.

@ParallelTest
public void testMultipleZipArtifact() {
    Build connectBuild = new BuildBuilder().withPlugins(new PluginBuilder().withName("my-connector-plugin").withArtifacts(zipArtifactNoChecksum, zipArtifactWithChecksum).build()).build();
    KafkaConnectDockerfile df = new KafkaConnectDockerfile("myImage:latest", connectBuild);
    assertThat(df.getDockerfile(), isEquivalent("FROM myImage:latest", "USER root:root", "RUN 'mkdir' '-p' '/opt/kafka/plugins/my-connector-plugin/d8d533bc' \\", "      && 'curl' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/d8d533bc.zip' 'https://mydomain.tld/my.zip' \\", "      && 'unzip' '/opt/kafka/plugins/my-connector-plugin/d8d533bc.zip' '-d' '/opt/kafka/plugins/my-connector-plugin/d8d533bc' \\", "      && 'find' '/opt/kafka/plugins/my-connector-plugin/d8d533bc' '-type' 'l' | 'xargs' 'rm' '-f' \\", "      && 'rm' '-vf' '/opt/kafka/plugins/my-connector-plugin/d8d533bc.zip'", "RUN 'mkdir' '-p' '/opt/kafka/plugins/my-connector-plugin/90e04094' \\", "      && 'curl' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip' 'https://mydomain.tld/my2.zip' \\", "      && 'echo' 'sha-512-checksum /opt/kafka/plugins/my-connector-plugin/90e04094.zip' > '/opt/kafka/plugins/my-connector-plugin/90e04094.zip.sha512' \\", "      && 'sha512sum' '--check' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip.sha512' \\", "      && 'rm' '-f' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip.sha512' \\", "      && 'unzip' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip' '-d' '/opt/kafka/plugins/my-connector-plugin/90e04094' \\", "      && 'find' '/opt/kafka/plugins/my-connector-plugin/90e04094' '-type' 'l' | 'xargs' 'rm' '-f' \\", "      && 'rm' '-vf' '/opt/kafka/plugins/my-connector-plugin/90e04094.zip'", "USER 1001"));
}
Also used : Build(io.strimzi.api.kafka.model.connect.build.Build) PluginBuilder(io.strimzi.api.kafka.model.connect.build.PluginBuilder) BuildBuilder(io.strimzi.api.kafka.model.connect.build.BuildBuilder) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 33 with BuildBuilder

use of io.strimzi.api.kafka.model.connect.build.BuildBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaConnectDockerfileTest method testChecksumOtherArtifactWithoutName.

@ParallelTest
public void testChecksumOtherArtifactWithoutName() {
    Build connectBuild = new BuildBuilder().withPlugins(new PluginBuilder().withName("my-connector-plugin").withArtifacts(otherArtifactWithChecksumWithoutName).build()).build();
    KafkaConnectDockerfile df = new KafkaConnectDockerfile("myImage:latest", connectBuild);
    assertThat(df.getDockerfile(), isEquivalent("FROM myImage:latest", "USER root:root", "RUN 'mkdir' '-p' '/opt/kafka/plugins/my-connector-plugin/2e6fee06' \\", "      && 'curl' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/2e6fee06/2e6fee06' 'https://mydomain.tld/download?artifactId=1874' \\", "      && 'echo' 'sha-512-checksum /opt/kafka/plugins/my-connector-plugin/2e6fee06/2e6fee06' > '/opt/kafka/plugins/my-connector-plugin/2e6fee06/2e6fee06.sha512' \\", "      && 'sha512sum' '--check' '/opt/kafka/plugins/my-connector-plugin/2e6fee06/2e6fee06.sha512' \\", "      && 'rm' '-f' '/opt/kafka/plugins/my-connector-plugin/2e6fee06/2e6fee06.sha512'", "USER 1001"));
}
Also used : Build(io.strimzi.api.kafka.model.connect.build.Build) PluginBuilder(io.strimzi.api.kafka.model.connect.build.PluginBuilder) BuildBuilder(io.strimzi.api.kafka.model.connect.build.BuildBuilder) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 34 with BuildBuilder

use of io.strimzi.api.kafka.model.connect.build.BuildBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaConnectDockerfileTest method testNoChecksumZipArtifact.

@ParallelTest
public void testNoChecksumZipArtifact() {
    Build connectBuild = new BuildBuilder().withPlugins(new PluginBuilder().withName("my-connector-plugin").withArtifacts(zipArtifactNoChecksum).build()).build();
    KafkaConnectDockerfile df = new KafkaConnectDockerfile("myImage:latest", connectBuild);
    assertThat(df.getDockerfile(), isEquivalent("FROM myImage:latest", "USER root:root", "RUN 'mkdir' '-p' '/opt/kafka/plugins/my-connector-plugin/d8d533bc' \\", "      && 'curl' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/d8d533bc.zip' 'https://mydomain.tld/my.zip' \\", "      && 'unzip' '/opt/kafka/plugins/my-connector-plugin/d8d533bc.zip' '-d' '/opt/kafka/plugins/my-connector-plugin/d8d533bc' \\", "      && 'find' '/opt/kafka/plugins/my-connector-plugin/d8d533bc' '-type' 'l' | 'xargs' 'rm' '-f' \\", "      && 'rm' '-vf' '/opt/kafka/plugins/my-connector-plugin/d8d533bc.zip'", "USER 1001"));
}
Also used : Build(io.strimzi.api.kafka.model.connect.build.Build) PluginBuilder(io.strimzi.api.kafka.model.connect.build.PluginBuilder) BuildBuilder(io.strimzi.api.kafka.model.connect.build.BuildBuilder) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Example 35 with BuildBuilder

use of io.strimzi.api.kafka.model.connect.build.BuildBuilder in project strimzi-kafka-operator by strimzi.

the class KafkaConnectDockerfileTest method testChecksumOtherArtifact.

@ParallelTest
public void testChecksumOtherArtifact() {
    Build connectBuild = new BuildBuilder().withPlugins(new PluginBuilder().withName("my-connector-plugin").withArtifacts(otherArtifactWithChecksum).build()).build();
    KafkaConnectDockerfile df = new KafkaConnectDockerfile("myImage:latest", connectBuild);
    assertThat(df.getDockerfile(), isEquivalent("FROM myImage:latest", "USER root:root", "RUN 'mkdir' '-p' '/opt/kafka/plugins/my-connector-plugin/2e6fee06' \\", "      && 'curl' '-L' '--output' '/opt/kafka/plugins/my-connector-plugin/2e6fee06/my2.so' 'https://mydomain.tld/download?artifactId=1874' \\", "      && 'echo' 'sha-512-checksum /opt/kafka/plugins/my-connector-plugin/2e6fee06/my2.so' > '/opt/kafka/plugins/my-connector-plugin/2e6fee06/my2.so.sha512' \\", "      && 'sha512sum' '--check' '/opt/kafka/plugins/my-connector-plugin/2e6fee06/my2.so.sha512' \\", "      && 'rm' '-f' '/opt/kafka/plugins/my-connector-plugin/2e6fee06/my2.so.sha512'", "USER 1001"));
}
Also used : Build(io.strimzi.api.kafka.model.connect.build.Build) PluginBuilder(io.strimzi.api.kafka.model.connect.build.PluginBuilder) BuildBuilder(io.strimzi.api.kafka.model.connect.build.BuildBuilder) ParallelTest(io.strimzi.test.annotations.ParallelTest)

Aggregations

Build (io.strimzi.api.kafka.model.connect.build.Build)36 BuildBuilder (io.strimzi.api.kafka.model.connect.build.BuildBuilder)36 ParallelTest (io.strimzi.test.annotations.ParallelTest)36 PluginBuilder (io.strimzi.api.kafka.model.connect.build.PluginBuilder)34 JarArtifact (io.strimzi.api.kafka.model.connect.build.JarArtifact)4 JarArtifactBuilder (io.strimzi.api.kafka.model.connect.build.JarArtifactBuilder)4 MavenArtifact (io.strimzi.api.kafka.model.connect.build.MavenArtifact)4 OtherArtifact (io.strimzi.api.kafka.model.connect.build.OtherArtifact)4 OtherArtifactBuilder (io.strimzi.api.kafka.model.connect.build.OtherArtifactBuilder)4 ZipArtifact (io.strimzi.api.kafka.model.connect.build.ZipArtifact)4 ZipArtifactBuilder (io.strimzi.api.kafka.model.connect.build.ZipArtifactBuilder)4 Artifact (io.strimzi.api.kafka.model.connect.build.Artifact)2 MavenArtifactBuilder (io.strimzi.api.kafka.model.connect.build.MavenArtifactBuilder)2 TgzArtifactBuilder (io.strimzi.api.kafka.model.connect.build.TgzArtifactBuilder)2 InvalidConfigurationException (io.strimzi.operator.common.InvalidConfigurationException)2