Skip to content

Commit 6889664

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

File tree

10 files changed

+81
-152
lines changed

10 files changed

+81
-152
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

+28-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
name: Build and Run Tests
2-
on: [pull_request]
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- trunk
7+
schedule:
8+
- cron: '0 0 * * 0' # Run every Sunday at midnight UTC
9+
310
jobs:
411
build:
512
name: Build
613
strategy:
714
fail-fast: false
815
matrix:
9-
java: [8, 11, 17]
16+
java: [ 8, 11, 17 ]
1017
runs-on: ubuntu-latest
1118

1219
steps:
@@ -31,29 +38,35 @@ jobs:
3138
- name: Misc tests
3239
run: ./gradlew ci --tests MiscTests
3340

34-
tests:
41+
ci:
3542
needs: build
36-
name: Tests
43+
name: Tests (CI)
44+
uses: ./.github/workflows/tests.yml
45+
with:
46+
image: ${{ fromJSON(vars.KURRENTDB_DOCKER_IMAGES).ci.fullname }}
47+
secrets: inherit
3748

38-
strategy:
39-
fail-fast: false
40-
matrix:
41-
version: [previous-lts, lts, latest, ci]
49+
lts:
50+
needs: build
51+
name: Tests (LTS)
52+
uses: ./.github/workflows/tests.yml
53+
with:
54+
image: ${{ fromJSON(vars.KURRENTDB_DOCKER_IMAGES).lts.fullname }}
55+
secrets: inherit
4256

57+
previous-lts:
58+
needs: build
59+
name: Tests (Previous LTS)
4360
uses: ./.github/workflows/tests.yml
4461
with:
45-
kdb_version: ${{ matrix.version }}
62+
image: ${{ fromJSON(vars.KURRENTDB_DOCKER_IMAGES)['previous-lts'].fullname }}
63+
secrets: inherit
4664

4765
plugins-tests:
4866
needs: build
4967
name: Plugins Tests
5068

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

.github/workflows/qa.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: QA
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
image:
7+
description: Docker full image name
8+
required: true
9+
type: string
10+
default: "docker.kurrent.io/eventstore/eventstoredb-ee:lts"
11+
12+
jobs:
13+
test:
14+
name: Test
15+
uses: ./.github/workflows/tests.yml
16+
with:
17+
image: ${{ inputs.image }}

.github/workflows/test-dispatch.yml

-22
This file was deleted.

.github/workflows/tests.yml

+25-22
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,12 @@ name: tests workflow
33
on:
44
workflow_call:
55
inputs:
6-
runtime_env:
7-
type: string
8-
default: release
9-
10-
kdb_version:
6+
image:
117
required: true
128
type: string
139

1410
jobs:
15-
provide_docker:
16-
uses: ./.github/workflows/docker-repo.yml
17-
with:
18-
runtime_env: ${{ inputs.runtime_env }}
19-
2011
single_node:
21-
needs: provide_docker
2212
name: Single node
2313

2414
strategy:
@@ -30,6 +20,13 @@ jobs:
3020
steps:
3121
- uses: actions/checkout@v4
3222

23+
- name: Login to Cloudsmith
24+
uses: docker/login-action@v3
25+
with:
26+
registry: docker.kurrent.io
27+
username: ${{ secrets.CLOUDSMITH_CICD_USER }}
28+
password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }}
29+
3330
- name: Set up JDK 8
3431
uses: actions/setup-java@v3
3532
with:
@@ -44,9 +41,7 @@ jobs:
4441
- name: Execute Gradle build
4542
run: ./gradlew ci --tests ${{ matrix.test }}Tests
4643
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 }}
44+
KURRENTDB_IMAGE: ${{ inputs.image }}
5045

5146
- uses: actions/upload-artifact@v4
5247
if: failure()
@@ -56,7 +51,6 @@ jobs:
5651
if-no-files-found: error
5752

5853
secure:
59-
needs: provide_docker
6054
name: Secure
6155

6256
strategy:
@@ -68,6 +62,13 @@ jobs:
6862
steps:
6963
- uses: actions/checkout@v4
7064

65+
- name: Login to Cloudsmith
66+
uses: docker/login-action@v3
67+
with:
68+
registry: docker.kurrent.io
69+
username: ${{ secrets.CLOUDSMITH_CICD_USER }}
70+
password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }}
71+
7172
- name: Generate certificates
7273
run: docker compose --file configure-tls-for-tests.yml up
7374

@@ -85,9 +86,7 @@ jobs:
8586
- name: Execute Gradle build
8687
run: ./gradlew ci --tests ${{ matrix.test }}Tests
8788
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 }}
89+
KURRENTDB_IMAGE: ${{ inputs.image }}
9190
SECURE: true
9291

9392
- uses: actions/upload-artifact@v4
@@ -97,7 +96,6 @@ jobs:
9796
path: /tmp/esdb_logs.tar.gz
9897

9998
cluster:
100-
needs: provide_docker
10199
name: Cluster
102100

103101
strategy:
@@ -109,12 +107,17 @@ jobs:
109107
steps:
110108
- uses: actions/checkout@v4
111109

110+
- name: Login to Cloudsmith
111+
uses: docker/login-action@v3
112+
with:
113+
registry: docker.kurrent.io
114+
username: ${{ secrets.CLOUDSMITH_CICD_USER }}
115+
password: ${{ secrets.CLOUDSMITH_CICD_TOKEN }}
116+
112117
- name: Set up cluster with Docker Compose
113118
run: docker compose up -d
114119
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 }}
120+
KURRENTDB_IMAGE: ${{ inputs.image }}
118121

119122
- name: Set up JDK 8
120123
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
}

0 commit comments

Comments
 (0)