Skip to content

Commit 12648d2

Browse files
committed
ci: update GH workflows as a result of the main branch being used for Registry 3.x
- Make sure the workflows are only triggered by updates on the 2.6.x branch. - Remove or fix some older workflows that have been previously only triggered on main. - Correctly build latest images. - Update Trivy scan config.
1 parent 4f2b917 commit 12648d2

14 files changed

+62
-60
lines changed

.github/scripts/build-and-push-multiarch-images.sh

+4-11
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,9 @@ then
5252
fi
5353

5454

55+
# In the past, if the branch name was "main", we have built and pushed images with tag "latest-{type}" instead of "{branch}-type".
56+
# But since main now contains code for Registry 3.x, which also uses different image repositories (apicurio-registry and apicurio-registry-ui),
57+
# we now need to use the latest tags for the latest minor branch (2.<minor>.x).
5558

56-
case $BRANCH_NAME in
59+
make IMAGE_REPO=${IMAGE_REPOSITORY} IMAGE_TAG=${BRANCH_NAME}-${RELEASE_TYPE} ${VARIANT}
5760

58-
"main"|"2.5.x")
59-
# if main branch, build images with tag "latest-${RELEASE_TYPE}"
60-
make IMAGE_REPO=${IMAGE_REPOSITORY} IMAGE_TAG=latest-${RELEASE_TYPE} ${VARIANT}
61-
;;
62-
63-
*)
64-
# if other than main, build images with tag "${BRANCH_NAME}-${RELEASE_TYPE}"
65-
make IMAGE_REPO=${IMAGE_REPOSITORY} IMAGE_TAG=${BRANCH_NAME}-${RELEASE_TYPE} ${VARIANT}
66-
;;
67-
esac

.github/workflows/dispatch-openapi.yaml

-25
This file was deleted.

.github/workflows/image-scan.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ jobs:
99
call-image-scan-registry-mem:
1010
uses: Apicurio/apicurio-gh-workflows/.github/workflows/image-scan.yaml@main
1111
with:
12-
image: quay.io/apicurio/apicurio-registry-mem:latest-snapshot
12+
image: quay.io/apicurio/apicurio-registry-mem:2.5.x-snapshot
1313

1414
call-image-scan-registry-sql:
1515
uses: Apicurio/apicurio-gh-workflows/.github/workflows/image-scan.yaml@main
1616
with:
17-
image: quay.io/apicurio/apicurio-registry-sql:latest-snapshot
17+
image: quay.io/apicurio/apicurio-registry-sql:2.5.x-snapshot
1818

1919
call-image-scan-registry-kafkasql:
2020
uses: Apicurio/apicurio-gh-workflows/.github/workflows/image-scan.yaml@main
2121
with:
22-
image: quay.io/apicurio/apicurio-registry-kafkasql:latest-snapshot
22+
image: quay.io/apicurio/apicurio-registry-kafkasql:2.5.x-snapshot
2323

.github/workflows/integration-tests.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77
- 'README*'
88
- 'docs/**'
99
- '.github/workflows/**'
10-
branches: [main, '[1-9].[1-9].x', 2.4.x, 2.5.x]
10+
branches: ['2.5.x']
1111
pull_request:
1212
paths-ignore:
1313
- '.gitignore'
1414
- 'LICENSE'
1515
- 'README*'
1616
- 'docs/**'
17-
branches: [main, '[1-9].[0-9].x']
17+
branches: ['2.5.x']
1818

1919
concurrency:
2020
# Only run once for latest commit per ref and cancel other (previous) runs.
@@ -51,7 +51,6 @@ jobs:
5151
IMAGE_TAG: 1d
5252
run: make build-sql-image push-sql-image
5353

54-
5554
prepare-kafkasql-tests:
5655
name: Prepare for KafkaSQL Integration Tests
5756
runs-on: ubuntu-20.04

.github/workflows/lint.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ on:
66
- 'LICENSE'
77
- 'README*'
88
- 'docs/**'
9-
branches: [main]
9+
branches: ['2.5.x']
1010
pull_request:
1111
paths-ignore:
1212
- '.gitignore'
1313
- 'LICENSE'
1414
- 'README*'
1515
- 'docs/**'
16-
branches: [main, 2.0.x]
16+
branches: ['2.5.x']
1717

1818
concurrency:
1919
# Only run once for latest commit per ref and cancel other (previous) runs.

.github/workflows/python-sdk.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77
- 'README*'
88
- 'docs/**'
99
- '.github/workflows/**'
10-
branches: [main, '[1-9].[0-9].x']
10+
branches: ['2.5.x']
1111
pull_request:
1212
paths-ignore:
1313
- '.gitignore'
1414
- 'LICENSE'
1515
- 'README*'
1616
- 'docs/**'
17-
branches: [main]
17+
branches: ['2.5.x']
1818

1919
jobs:
2020
build-verify:

.github/workflows/release-images.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@ env:
1919

2020
jobs:
2121
release-images:
22-
if: github.repository_owner == 'Apicurio' && (github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, '2.5.'))
22+
if: github.repository_owner == 'Apicurio'
2323
runs-on: ubuntu-20.04
2424
timeout-minutes: 120
2525
env:
2626
RELEASE_TYPE: release
2727
steps:
28+
29+
- name: Check Prerequisites
30+
if: github.event_name != 'workflow_dispatch' && !startsWith(github.event.release.tag_name, '2.5.')
31+
run: |
32+
exit 1
33+
2834
- name: View Disk Usage
2935
run: df -h
3036

.github/workflows/tag-registry-examples.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121
jobs:
2222
tag-registry-examples:
2323
runs-on: ubuntu-20.04
24+
if: false # Registry Examples repository is archived, since we moved them to the Registry repository. This workflow can be later removed.
2425
steps:
2526
- name: Set Versions
2627
run: |

.github/workflows/update-openapi.yaml

+3-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- common/src/main/resources/META-INF/openapi.json
66
- utils/tools/src/main/java/io/apicurio/registry/utils/tools/AddOpenApiAuth.java
77
- utils/tools/src/main/java/io/apicurio/registry/utils/tools/TransformOpenApiForClientGen.java
8-
branches: [ main ]
8+
branches: [ '2.5.x' ]
99

1010
jobs:
1111
update-openapi:
@@ -22,8 +22,8 @@ jobs:
2222
git config --global user.email "apicurio.ci@gmail.com"
2323
git remote add origin "https://apicurio-ci:${{ secrets.ACCESS_TOKEN }}@github.com/Apicurio/apicurio-registry.git"
2424
git fetch
25-
git checkout main
26-
git branch --set-upstream-to=origin/main
25+
git checkout 2.5.x
26+
git branch --set-upstream-to=origin/2.5.x
2727
git pull
2828
2929
- name: Set up JDK 17
@@ -61,7 +61,3 @@ jobs:
6161
validate:
6262
needs: update-openapi
6363
uses: ./.github/workflows/validate-openapi.yaml
64-
65-
dispatch:
66-
needs: validate
67-
uses: ./.github/workflows/dispatch-openapi.yaml

.github/workflows/update-website.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ on:
66

77
jobs:
88
update-website:
9-
if: github.repository_owner == 'Apicurio' && (github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, '2.5.'))
9+
if: github.repository_owner == 'Apicurio'
1010
runs-on: ubuntu-20.04
1111
steps:
1212

13+
- name: Check Prerequisites
14+
if: github.event_name != 'workflow_dispatch' && !startsWith(github.event.release.tag_name, '2.5.')
15+
run: |
16+
exit 1
17+
1318
- name: Apicurio Website Checkout
1419
run: |
1520
mkdir website

.github/workflows/validate-openapi.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: Validate OpenAPI schema with Spectral
22
on:
33
workflow_call: { }
44
pull_request:
5-
branches:
6-
- main
5+
branches: ['2.5.x']
76
paths:
87
- common/src/main/resources/META-INF/openapi.json
98

.github/workflows/verify.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77
- 'README*'
88
- 'docs/**'
99
- '.github/workflows/**'
10-
branches: [main, '[1-9].[0-9].x']
10+
branches: ['2.5.x']
1111
pull_request:
1212
paths-ignore:
1313
- '.gitignore'
1414
- 'LICENSE'
1515
- 'README*'
1616
- 'docs/**'
17-
branches: [main, '[1-9].[0-9].x']
17+
branches: ['2.5.x']
1818

1919
concurrency:
2020
# Only run once for latest commit per ref and cancel other (previous) runs.

Makefile

+26
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ DOCKER_BUILD_WORKSPACE ?= $(DOCKERFILE_LOCATION)
1616
IMAGE_REPO ?= docker.io
1717
IMAGE_GROUP ?= apicurio
1818
IMAGE_TAG ?= latest
19+
ADDITIONAL_IMAGE_TAG ?= none
1920
IMAGE_PLATFORMS ?= linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
2021
SKIP_TESTS ?= false
2122
INTEGRATION_TESTS_PROFILE ?= ci
@@ -284,8 +285,13 @@ mem-multiarch-images:
284285
@echo " Supported Platforms: $(IMAGE_PLATFORMS)"
285286
@echo " Repository: $(IMAGE_REPO)"
286287
@echo " Tag: $(IMAGE_TAG)"
288+
@echo " Additional image tag: $(ADDITIONAL_IMAGE_TAG)"
287289
@echo "------------------------------------------------------------------------"
288290
docker buildx build --push -f $(DOCKERFILE_LOCATION)/$(MEM_DOCKERFILE) -t $(IMAGE_REPO)/$(IMAGE_GROUP)/apicurio-registry-mem:$(IMAGE_TAG) --platform $(IMAGE_PLATFORMS) $(DOCKER_BUILD_WORKSPACE)
291+
ifneq ($(ADDITIONAL_IMAGE_TAG), none)
292+
@echo "Publishing additional tag: $(ADDITIONAL_IMAGE_TAG)"
293+
docker buildx build --push -f $(DOCKERFILE_LOCATION)/$(MEM_DOCKERFILE) -t $(IMAGE_REPO)/$(IMAGE_GROUP)/apicurio-registry-mem:$(ADDITIONAL_IMAGE_TAG) --platform $(IMAGE_PLATFORMS) $(DOCKER_BUILD_WORKSPACE)
294+
endif
289295

290296
.PHONY: sql-multiarch-images ## Builds and pushes multi-arch images for 'sql' storage variant. Variables available for override [SQL_DOCKERFILE, IMAGE_REPO, IMAGE_TAG, DOCKER_BUILD_WORKSPACE]
291297
sql-multiarch-images:
@@ -294,8 +300,13 @@ sql-multiarch-images:
294300
@echo " Supported Platforms: $(IMAGE_PLATFORMS)"
295301
@echo " Repository: $(IMAGE_REPO)"
296302
@echo " Tag: $(IMAGE_TAG)"
303+
@echo " Additional image tag: $(ADDITIONAL_IMAGE_TAG)"
297304
@echo "------------------------------------------------------------------------"
298305
docker buildx build --push -f $(DOCKERFILE_LOCATION)/$(SQL_DOCKERFILE) -t $(IMAGE_REPO)/$(IMAGE_GROUP)/apicurio-registry-sql:$(IMAGE_TAG) --platform $(IMAGE_PLATFORMS) $(DOCKER_BUILD_WORKSPACE)
306+
ifneq ($(ADDITIONAL_IMAGE_TAG), none)
307+
@echo "Publishing additional tag: $(ADDITIONAL_IMAGE_TAG)"
308+
docker buildx build --push -f $(DOCKERFILE_LOCATION)/$(SQL_DOCKERFILE) -t $(IMAGE_REPO)/$(IMAGE_GROUP)/apicurio-registry-sql:$(ADDITIONAL_IMAGE_TAG) --platform $(IMAGE_PLATFORMS) $(DOCKER_BUILD_WORKSPACE)
309+
endif
299310

300311
.PHONY: mssql-multiarch-images ## Builds and pushes multi-arch images for 'mssql' storage variant. Variables available for override [MSSQL_DOCKERFILE, IMAGE_REPO, IMAGE_TAG, DOCKER_BUILD_WORKSPACE]
301312
mssql-multiarch-images:
@@ -304,8 +315,13 @@ mssql-multiarch-images:
304315
@echo " Supported Platforms: $(IMAGE_PLATFORMS)"
305316
@echo " Repository: $(IMAGE_REPO)"
306317
@echo " Tag: $(IMAGE_TAG)"
318+
@echo " Additional image tag: $(ADDITIONAL_IMAGE_TAG)"
307319
@echo "------------------------------------------------------------------------"
308320
docker buildx build --push -f $(DOCKERFILE_LOCATION)/$(MSSQL_DOCKERFILE) -t $(IMAGE_REPO)/$(IMAGE_GROUP)/apicurio-registry-mssql:$(IMAGE_TAG) --platform $(IMAGE_PLATFORMS) $(DOCKER_BUILD_WORKSPACE)
321+
ifneq ($(ADDITIONAL_IMAGE_TAG), none)
322+
@echo "Publishing additional tag: $(ADDITIONAL_IMAGE_TAG)"
323+
docker buildx build --push -f $(DOCKERFILE_LOCATION)/$(MSSQL_DOCKERFILE) -t $(IMAGE_REPO)/$(IMAGE_GROUP)/apicurio-registry-mssql:$(ADDITIONAL_IMAGE_TAG) --platform $(IMAGE_PLATFORMS) $(DOCKER_BUILD_WORKSPACE)
324+
endif
309325

310326
.PHONY: mysql-multiarch-images ## Builds and pushes multi-arch images for 'mysql' storage variant. Variables available for override [MYSQL_DOCKERFILE, IMAGE_REPO, IMAGE_TAG, DOCKER_BUILD_WORKSPACE]
311327
mysql-multiarch-images:
@@ -314,8 +330,13 @@ mysql-multiarch-images:
314330
@echo " Supported Platforms: $(IMAGE_PLATFORMS)"
315331
@echo " Repository: $(IMAGE_REPO)"
316332
@echo " Tag: $(IMAGE_TAG)"
333+
@echo " Additional image tag: $(ADDITIONAL_IMAGE_TAG)"
317334
@echo "------------------------------------------------------------------------"
318335
docker buildx build --push -f $(DOCKERFILE_LOCATION)/$(MYSQL_DOCKERFILE) -t $(IMAGE_REPO)/apicurio/apicurio-registry-mysql:$(IMAGE_TAG) --platform $(IMAGE_PLATFORMS) $(DOCKER_BUILD_WORKSPACE)
336+
ifneq ($(ADDITIONAL_IMAGE_TAG), none)
337+
@echo "Publishing additional tag: $(ADDITIONAL_IMAGE_TAG)"
338+
docker buildx build --push -f $(DOCKERFILE_LOCATION)/$(MYSQL_DOCKERFILE) -t $(IMAGE_REPO)/apicurio/apicurio-registry-mysql:$(ADDITIONAL_IMAGE_TAG) --platform $(IMAGE_PLATFORMS) $(DOCKER_BUILD_WORKSPACE)
339+
endif
319340

320341
.PHONY: kafkasql-multiarch-images ## Builds and pushes multi-arch images for kafkasql storage variant. Variables available for override [KAFKASQL_DOCKERFILE, IMAGE_REPO, IMAGE_TAG, DOCKER_BUILD_WORKSPACE]
321342
kafkasql-multiarch-images:
@@ -324,8 +345,13 @@ kafkasql-multiarch-images:
324345
@echo " Supported Platforms: $(IMAGE_PLATFORMS)"
325346
@echo " Repository: $(IMAGE_REPO)"
326347
@echo " Tag: $(IMAGE_TAG)"
348+
@echo " Additional image tag: $(ADDITIONAL_IMAGE_TAG)"
327349
@echo "------------------------------------------------------------------------"
328350
docker buildx build --push -f $(DOCKERFILE_LOCATION)/$(KAFKASQL_DOCKERFILE) -t $(IMAGE_REPO)/$(IMAGE_GROUP)/apicurio-registry-kafkasql:$(IMAGE_TAG) --platform $(IMAGE_PLATFORMS) $(DOCKER_BUILD_WORKSPACE)
351+
ifneq ($(ADDITIONAL_IMAGE_TAG), none)
352+
@echo "Publishing additional tag: $(ADDITIONAL_IMAGE_TAG)"
353+
docker buildx build --push -f $(DOCKERFILE_LOCATION)/$(KAFKASQL_DOCKERFILE) -t $(IMAGE_REPO)/$(IMAGE_GROUP)/apicurio-registry-kafkasql:$(ADDITIONAL_IMAGE_TAG) --platform $(IMAGE_PLATFORMS) $(DOCKER_BUILD_WORKSPACE)
354+
endif
329355

330356
.PHONY: mem-native-scratch-image ## Builds and pushes multi-arch images for mem storage variant based on scratch. Variables available for override [MEM_SCRATCH_DOCKERFILE, IMAGE_REPO, IMAGE_TAG, DOCKER_BUILD_WORKSPACE]
331357
mem-native-scratch-image:

scripts/validate-files.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ done
2020
echo "DB version ok between build and DDLs"
2121

2222
echo "Linting openshift templates"
23-
spectral lint distro/openshift-template/mt/apicurio-registry-mt-template.yaml --ruleset scripts/ocp-template-ruleset.js
23+
spectral lint distro/openshift-template/mt/apicurio-registry-template-mem.yml --ruleset scripts/ocp-template-ruleset.js
24+
spectral lint distro/openshift-template/mt/apicurio-registry-template-sql.yml --ruleset scripts/ocp-template-ruleset.js
25+
spectral lint distro/openshift-template/mt/apicurio-registry-template-kafkasql.yml --ruleset scripts/ocp-template-ruleset.js

0 commit comments

Comments
 (0)