Skip to content

Commit

Permalink
Allow specifying CilckHouse docker image version
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Jan 17, 2022
1 parent d648bb7 commit 7341c61
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package io.trino.plugin.clickhouse;

import org.testcontainers.containers.ClickHouseContainer;
import org.testcontainers.utility.DockerImageName;

import java.io.Closeable;
import java.sql.Connection;
Expand All @@ -27,13 +28,19 @@
public class TestingClickHouseServer
implements Closeable
{
private static final String CLICKHOUSE_IMAGE = "yandex/clickhouse-server:20.8";
private static final DockerImageName CLICKHOUSE_IMAGE = DockerImageName.parse("yandex/clickhouse-server");
public static final String LATEST_VERSION = "21.11.10.1";
public static final String DEFAULT_VERSION = "20.8";
private final ClickHouseContainer dockerContainer;

public TestingClickHouseServer()
{
// Use 2nd stable version
dockerContainer = (ClickHouseContainer) new ClickHouseContainer(CLICKHOUSE_IMAGE)
this(DEFAULT_VERSION);
}

public TestingClickHouseServer(String version)
{
dockerContainer = (ClickHouseContainer) new ClickHouseContainer(CLICKHOUSE_IMAGE.withTag(version))
.withCopyFileToContainer(forClasspathResource("custom.xml"), "/etc/clickhouse-server/config.d/custom.xml")
.withStartupAttempts(10);

Expand Down

0 comments on commit 7341c61

Please sign in to comment.