Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log docker tag in startup #841

Merged
merged 4 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:

- name: Build Docker image (Lightweight)
run: |
docker build . --file sink-connector-lightweight/Dockerfile --tag altinityinfra/clickhouse-sink-connector:${{ env.IMAGE_TAG }}-lt
docker build . --file sink-connector-lightweight/Dockerfile --build-arg DOCKER_TAG=${{ env.IMAGE_TAG }} --tag altinityinfra/clickhouse-sink-connector:${{ env.IMAGE_TAG }}-lt
docker save altinityinfra/clickhouse-sink-connector:${{ env.IMAGE_TAG }}-lt | gzip > clickhouse-sink-connector_${{ env.IMAGE_TAG }}-lt.tar.gz

- name: Upload Docker tar (Lightweight)
Expand Down
Empty file added doc/quickstart_ms_sql_server.md
Empty file.
2 changes: 2 additions & 0 deletions sink-connector-lightweight/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM openjdk:17
ARG DOCKER_TAG
ENV DOCKER_TAG=${DOCKER_TAG}
COPY sink-connector-client/sink-connector-client /sink-connector-client
COPY sink-connector-lightweight/target/clickhouse-debezium-embedded-*.jar /app.jar
ENV JAVA_OPTS="-Dlog4jDebug=true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public class ClickHouseDebeziumEmbeddedApplication {

public static void main(String[] args) throws Exception {

//BasicConfigurator.configure();

Log4jBridgeHandler.install(false, "", true);
System.setProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager");
Expand All @@ -69,6 +68,7 @@ public static void main(String[] args) throws Exception {
}
injector = Guice.createInjector(new AppInjector());

printDockerInfo();
props = new Properties();
if(args.length > 0) {
log.info(String.format("****** CONFIGURATION FILE: %s ********", args[0]));
Expand Down Expand Up @@ -96,6 +96,22 @@ public static void main(String[] args) throws Exception {
}
}

private static void printDockerInfo() {
try {

String dockerTag = System.getenv("DOCKER_TAG");
// log the docker tag if it is set
if(dockerTag != null) {
//Extract the string after :
// altinityinfra/clickhouse-sink-connector:${{ env.IMAGE_TAG }}-lt
//String version = dockerTag.substring(dockerTag.indexOf(":") + 1);
log.info("***** Sink Connector Release version: *********** " + dockerTag);
}
} catch(Exception e) {
log.error("Error printing docker info", e);
}
}

/**
* Function to load properties from user provided file path
* @param filePath user provided file path
Expand Down
Empty file.
Loading