Skip to content

Commit 2180d36

Browse files
committed
chore: use github var for kurrentdb images
1 parent a6cfe08 commit 2180d36

File tree

8 files changed

+55
-125
lines changed

8 files changed

+55
-125
lines changed

.github/workflows/docker-repo.yml

-49
This file was deleted.

.github/workflows/plugins-tests.yml

+4-15
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,12 @@ on:
88
type: string
99
default: enterprise
1010

11-
kdb_version:
11+
image:
1212
required: true
1313
type: string
1414

1515
jobs:
16-
provide_docker:
17-
uses: ./.github/workflows/docker-repo.yml
18-
with:
19-
runtime_env: ${{ inputs.runtime_env }}
20-
2116
single_node:
22-
needs: provide_docker
2317
name: Single Node
2418

2519
strategy:
@@ -32,7 +26,7 @@ jobs:
3226
- name: Login to Cloudsmith
3327
uses: docker/login-action@v3
3428
with:
35-
registry: docker.eventstore.com
29+
registry: docker.kurrent.io
3630
username: ${{ secrets.CLOUDSMITH_CICD_USER }}
3731
password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }}
3832

@@ -57,9 +51,7 @@ jobs:
5751
- name: Execute Gradle build
5852
run: ./gradlew ci --tests ${{ matrix.test }}Tests
5953
env:
60-
KURRENT_DOCKER_REGISTRY_ENV: docker.eventstore.com
61-
KURRENT_DOCKER_IMAGE_ENV: ${{ needs.provide_docker.outputs.docker_repo }}/${{ needs.provide_docker.outputs.docker_container }}
62-
KURRENT_DOCKER_TAG_ENV: ${{ inputs.kdb_version }}
54+
KURRENTDB_IMAGE: ${{ inputs.image }}
6355
SECURE: true
6456

6557
- uses: actions/upload-artifact@v4
@@ -70,7 +62,6 @@ jobs:
7062
if-no-files-found: error
7163

7264
cluster:
73-
needs: provide_docker
7465
name: Cluster
7566

7667
strategy:
@@ -95,9 +86,7 @@ jobs:
9586
- name: Set up cluster with Docker Compose
9687
run: docker compose up -d
9788
env:
98-
CONTAINER_REGISTRY: docker.eventstore.com
99-
CONTAINER_IMAGE: ${{ needs.provide_docker.outputs.docker_repo }}/${{ needs.provide_docker.outputs.docker_container }}
100-
CONTAINER_IMAGE_VERSION: ${{ inputs.kdb_version }}
89+
KURRENTDB_IMAGE: ${{ inputs.image }}
10190

10291
- name: Generate user certificates
10392
run: docker compose --file configure-user-certs-for-tests.yml up

.github/workflows/release.yml renamed to .github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
jobs:
1616
publish:
17-
name: Publish${{ inputs.dry_run && inputs.dry_run == 'true' && ' (dry run)' || '' }}
17+
name: Publish
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@v4

.github/workflows/pull-requests.yml

+21-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: Build and Run Tests
2-
on: [pull_request]
2+
on: [ pull_request ]
33
jobs:
44
build:
55
name: Build
66
strategy:
77
fail-fast: false
88
matrix:
9-
java: [8, 11, 17]
9+
java: [ 8, 11, 17 ]
1010
runs-on: ubuntu-latest
1111

1212
steps:
@@ -31,29 +31,35 @@ jobs:
3131
- name: Misc tests
3232
run: ./gradlew ci --tests MiscTests
3333

34-
tests:
34+
ci:
3535
needs: build
36-
name: Tests
36+
name: Tests (CI)
37+
uses: ./.github/workflows/tests.yml
38+
with:
39+
image: ${{ fromJSON(vars.KURRENTDB_DOCKER_IMAGES).ci.fullname }}
40+
secrets: inherit
3741

38-
strategy:
39-
fail-fast: false
40-
matrix:
41-
version: [previous-lts, lts, latest, ci]
42+
lts:
43+
needs: build
44+
name: Tests (LTS)
45+
uses: ./.github/workflows/tests.yml
46+
with:
47+
image: ${{ fromJSON(vars.KURRENTDB_DOCKER_IMAGES).lts.fullname }}
48+
secrets: inherit
4249

50+
previous-lts:
51+
needs: build
52+
name: Tests (Previous LTS)
4353
uses: ./.github/workflows/tests.yml
4454
with:
45-
kdb_version: ${{ matrix.version }}
55+
image: ${{ fromJSON(vars.KURRENTDB_DOCKER_IMAGES)['previous-lts'].fullname }}
56+
secrets: inherit
4657

4758
plugins-tests:
4859
needs: build
4960
name: Plugins Tests
5061

51-
strategy:
52-
fail-fast: false
53-
matrix:
54-
version: [24.2.0-jammy]
55-
5662
uses: ./.github/workflows/plugins-tests.yml
5763
with:
58-
kdb_version: ${{ matrix.version }}
64+
image: "docker.eventstore.com/eventstore-ee/eventstoredb-commercial:24.2.0-jammy"
5965
secrets: inherit

.github/workflows/tests.yml

+25-18
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,12 @@ on:
77
type: string
88
default: release
99

10-
kdb_version:
10+
image:
1111
required: true
1212
type: string
1313

1414
jobs:
15-
provide_docker:
16-
uses: ./.github/workflows/docker-repo.yml
17-
with:
18-
runtime_env: ${{ inputs.runtime_env }}
19-
2015
single_node:
21-
needs: provide_docker
2216
name: Single node
2317

2418
strategy:
@@ -30,6 +24,13 @@ jobs:
3024
steps:
3125
- uses: actions/checkout@v4
3226

27+
- name: Login to Cloudsmith
28+
uses: docker/login-action@v3
29+
with:
30+
registry: docker.kurrent.io
31+
username: ${{ secrets.CLOUDSMITH_CICD_USER }}
32+
password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }}
33+
3334
- name: Set up JDK 8
3435
uses: actions/setup-java@v3
3536
with:
@@ -44,9 +45,7 @@ jobs:
4445
- name: Execute Gradle build
4546
run: ./gradlew ci --tests ${{ matrix.test }}Tests
4647
env:
47-
KURRENT_DOCKER_REGISTRY_ENV: docker.eventstore.com
48-
KURRENT_DOCKER_IMAGE_ENV: ${{ needs.provide_docker.outputs.docker_repo }}/${{ needs.provide_docker.outputs.docker_container }}
49-
KURRENT_DOCKER_TAG_ENV: ${{ inputs.kdb_version }}
48+
KURRENTDB_IMAGE: ${{ inputs.image }}
5049

5150
- uses: actions/upload-artifact@v4
5251
if: failure()
@@ -56,7 +55,6 @@ jobs:
5655
if-no-files-found: error
5756

5857
secure:
59-
needs: provide_docker
6058
name: Secure
6159

6260
strategy:
@@ -68,6 +66,13 @@ jobs:
6866
steps:
6967
- uses: actions/checkout@v4
7068

69+
- name: Login to Cloudsmith
70+
uses: docker/login-action@v3
71+
with:
72+
registry: docker.kurrent.io
73+
username: ${{ secrets.CLOUDSMITH_CICD_USER }}
74+
password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }}
75+
7176
- name: Generate certificates
7277
run: docker compose --file configure-tls-for-tests.yml up
7378

@@ -85,9 +90,7 @@ jobs:
8590
- name: Execute Gradle build
8691
run: ./gradlew ci --tests ${{ matrix.test }}Tests
8792
env:
88-
KURRENT_DOCKER_REGISTRY_ENV: docker.eventstore.com
89-
KURRENT_DOCKER_IMAGE_ENV: ${{ needs.provide_docker.outputs.docker_repo }}/${{ needs.provide_docker.outputs.docker_container }}
90-
KURRENT_DOCKER_TAG_ENV: ${{ inputs.kdb_version }}
93+
KURRENTDB_IMAGE: ${{ inputs.image }}
9194
SECURE: true
9295

9396
- uses: actions/upload-artifact@v4
@@ -97,7 +100,6 @@ jobs:
97100
path: /tmp/esdb_logs.tar.gz
98101

99102
cluster:
100-
needs: provide_docker
101103
name: Cluster
102104

103105
strategy:
@@ -109,12 +111,17 @@ jobs:
109111
steps:
110112
- uses: actions/checkout@v4
111113

114+
- name: Login to Cloudsmith
115+
uses: docker/login-action@v3
116+
with:
117+
registry: docker.kurrent.io
118+
username: ${{ secrets.CLOUDSMITH_CICD_USER }}
119+
password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }}
120+
112121
- name: Set up cluster with Docker Compose
113122
run: docker compose up -d
114123
env:
115-
CONTAINER_REGISTRY: docker.eventstore.com
116-
CONTAINER_IMAGE: ${{ needs.provide_docker.outputs.docker_repo }}/${{ needs.provide_docker.outputs.docker_container }}
117-
CONTAINER_IMAGE_VERSION: ${{ inputs.kdb_version }}
124+
KURRENTDB_IMAGE: ${{ inputs.image }}
118125

119126
- name: Set up JDK 8
120127
uses: actions/setup-java@v3

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ services:
2626
- volumes-provisioner
2727

2828
esdb-node1: &template
29-
image: ${CONTAINER_REGISTRY:-docker.eventstore.com}/${CONTAINER_IMAGE:-eventstore-ce/eventstoredb-ce}:${CONTAINER_IMAGE_VERSION:-latest}
29+
image: ${KURRENTDB_IMAGE:-docker.kurrent.io/eventstore/eventstoredb-ee:lts}
3030
env_file:
3131
- vars.env
3232
environment:

src/test/java/io/kurrent/dbclient/DatabaseFactory.java

+2-8
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,8 @@ public static Database spawnEnterpriseWithPluginsEnabled(String... pluginsToEnab
3636
private static DockerContainerDatabase.Builder singleNodeBuilder() {
3737
return DockerContainerDatabase
3838
.builder()
39-
.registry(Optional
40-
.ofNullable(System.getenv("KURRENT_DOCKER_REGISTRY_ENV"))
41-
.orElse(DockerContainerDatabase.DEFAULT_REGISTRY))
4239
.image(Optional
43-
.ofNullable(System.getenv("KURRENT_DOCKER_IMAGE_ENV"))
44-
.orElse(DockerContainerDatabase.DEFAULT_IMAGE))
45-
.version(Optional
46-
.ofNullable(System.getenv("KURRENT_DOCKER_TAG_ENV"))
47-
.orElse(DockerContainerDatabase.DEFAULT_VERSION));
40+
.ofNullable(System.getenv("KURRENTDB_IMAGE"))
41+
.orElse(DockerContainerDatabase.DEFAULT_IMAGE));
4842
}
4943
}

src/test/java/io/kurrent/dbclient/databases/DockerContainerDatabase.java

+1-18
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,16 @@
1212
import java.util.Map;
1313

1414
public class DockerContainerDatabase extends GenericContainer<DockerContainerDatabase> implements Database {
15-
public static final String DEFAULT_REGISTRY = "docker.eventstore.com";
1615
public static final String DEFAULT_IMAGE = "eventstore-ce/eventstoredb-ce";
17-
public static final String DEFAULT_VERSION = "latest";
1816

1917
public static class Builder {
20-
String registry;
2118
String image;
22-
String version;
2319
boolean secure;
2420
boolean anonymous;
2521
Map<String, String> env;
2622

2723
public Builder() {
28-
this.registry = DEFAULT_REGISTRY;
2924
this.image = DEFAULT_IMAGE;
30-
this.version = DEFAULT_VERSION;
3125
this.env = new HashMap<>();
3226
}
3327

@@ -36,11 +30,6 @@ public Builder secure(boolean secure) {
3630
return this;
3731
}
3832

39-
public Builder version(String version) {
40-
this.version = version;
41-
return this;
42-
}
43-
4433
public Builder anonymous(boolean anonymous) {
4534
this.anonymous = anonymous;
4635
return this;
@@ -50,12 +39,6 @@ public Builder image(String image) {
5039
this.image = image;
5140
return this;
5241
}
53-
54-
public Builder registry(String registry) {
55-
this.registry = registry;
56-
return this;
57-
}
58-
5942
public Builder env(String envVar, String value) {
6043
this.env.put(envVar, value);
6144
return this;
@@ -70,7 +53,7 @@ public DockerContainerDatabase build() {
7053
private final ClientTracker clientTracker;
7154

7255
public DockerContainerDatabase(Builder builder) {
73-
super(String.format("%s/%s:%s", builder.registry, builder.image, builder.version));
56+
super(builder.image);
7457
addExposedPorts(1113, 2113);
7558

7659
withEnv("EVENTSTORE_RUN_PROJECTIONS", "ALL");

0 commit comments

Comments
 (0)