Skip to content

Commit

Permalink
DBZ-8046 Add workflow to manually deploy connector to docker hub for …
Browse files Browse the repository at this point in the history
…local testing
  • Loading branch information
ShuranZhang committed Jul 10, 2024
1 parent 7c5df9d commit eeec45c
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 5 deletions.
34 changes: 34 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,9 @@
<configuration>
<repository>${docker.repository.name}</repository>
<skip>${docker.skip.push}</skip>
<buildArgs>
<projectVersion>${project.version}</projectVersion>
</buildArgs>
<images>
<image>
<name>${docker.repository.name}:${docker.tag.name}</name>
Expand Down Expand Up @@ -624,6 +627,37 @@
</plugins>
</build>
</profile>
<profile>
<id>pack-local-changes</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${version.assembly.plugin}</version>
<executions>
<execution>
<id>pack-local-changes</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}</finalName>
<descriptors>
<descriptor>src/test/docker/distribution.xml</descriptor>
</descriptors>
<tarLongFileMode>posix</tarLongFileMode>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>skip-integration-tests</id>
<activation>
Expand Down
12 changes: 7 additions & 5 deletions src/test/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM confluentinc/cp-kafka-connect-base:7.2.2
COPY target/components/packages/google-debezium-connector-spanner-*.zip /usr/share/confluent-hub-components/google-debezium-connector-spanner.zip
FROM confluentinc/cp-kafka-connect-base:latest
ARG projectVersion
USER root
RUN yum remove -y zulu11-ca-jdk-headless && yum remove -y zulu11-ca-jre-headless
RUN yum install -y zulu17-ca-jdk-headless && yum install -y zulu17-ca-jre-headless
USER appuser
COPY target/debezium-connector-spanner-${projectVersion}-plugin/ /usr/share/java/google-debezium-connector-spanner/
COPY src/test/docker/jmx_prometheus_javaagent-0.16.1.jar /usr/share/prometheus/jmx_prometheus_javaagent.jar
COPY src/test/docker/metrics-config.yml /usr/share/prometheus/metrics-config.yml
RUN confluent-hub install --no-prompt wepay/kafka-connect-bigquery:latest
RUN confluent-hub install --no-prompt /usr/share/confluent-hub-components/google-debezium-connector-spanner.zip
#CMD ["/bin/bash", "-c", "/etc/confluent/docker/run &; sleep infinity"]
58 changes: 58 additions & 0 deletions src/test/docker/distribution.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0"?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>plugin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>${project.artifactId}</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveFiltering>true</useTransitiveFiltering>
<excludes>
<!-- Exclude dependencies of Kafka APIs, since they will be available in the runtime -->
<exclude>com.fasterxml.jackson.core:jackson-core:*</exclude>
<exclude>com.fasterxml.jackson.core:jackson-databind:*</exclude>
<exclude>com.fasterxml.jackson.core:jackson-annotations:*</exclude>
<exclude>com.fasterxml.jackson.datatype:jackson-datatype-jsr310:*</exclude>

<!-- Exclude guava dependencies -->
<exclude>com.google.guava:listenablefuture:*</exclude>

<!-- Exclude dependencies with incorrect scope -->
<exclude>org.checkerframework:checker-qual:*</exclude>
</excludes>
</dependencySet>
<dependencySet>
<outputDirectory>${project.artifactId}</outputDirectory>
<unpack>false</unpack>
<includes>
<include>${project.groupId}:${project.artifactId}:*</include>
</includes>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${project.basedir}</directory>
<outputDirectory>${project.artifactId}</outputDirectory>
<includes>
<include>README*</include>
<include>LICENSE*</include>
</includes>
<useDefaultExcludes>true</useDefaultExcludes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/generated-sources</directory>
<outputDirectory>${project.artifactId}</outputDirectory>
<includes>
<include>*.json</include>
</includes>
<useDefaultExcludes>true</useDefaultExcludes>
</fileSet>
</fileSets>
</assembly>

0 comments on commit eeec45c

Please sign in to comment.