Skip to content

Commit a44b189

Browse files
committed
adding CRD model gen action job
1 parent d680d1f commit a44b189

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

.github/workflows/maven.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,29 @@ jobs:
6363
-B \
6464
-De2e.skip=false \
6565
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
66+
codegen:
67+
runs-on: ubuntu-latest
68+
services:
69+
registry:
70+
image: registry:2
71+
ports:
72+
- 5000:5000
73+
name: CRD Java Models Code Generation
74+
steps:
75+
- name: Publish to Registry
76+
uses: elgohr/Publish-Docker-Github-Action@master
77+
with:
78+
name: kubernetes-client/java/crd-model-gen
79+
tags: gh-action-tmp
80+
username: ${{ github.actor }}
81+
password: ${{ secrets.GITHUB_TOKEN }}
82+
registry: docker.pkg.github.com
83+
workdir: client-java-contrib
84+
no_push: true
85+
- name: Run Code-gen for Cert-Manager
86+
working-directory: ${{ github.workspace }}/client-java-contrib/cert-manager
87+
run: IMAGE_TAG=gh-action-tmp ./update.sh
88+
- name: Run Code-gen for Prometheus-Operator
89+
working-directory: ${{ github.workspace }}/client-java-contrib/prometheus-operator
90+
run: IMAGE_TAG=gh-action-tmp ./update.sh
91+

client-java-contrib/cert-manager/update.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@
1616
# This script generates the model classes from a released version of cert-manager CRDs
1717
# under src/main/java/io/cert/manager/models.
1818

19+
IMAGE_NAME=${IMAGE_NAME:docker.pkg.github.com/kubernetes-client/java/crd-model-gen}
20+
IMAGE_TAG=${IMAGE_TAG:v1.0.2}
21+
1922
# a crdgen container is run in a way that:
2023
# 1. it has access to the docker daemon on the host so that it is able to create sibling container on the host
2124
# 2. it runs on the host network so that it is able to communicate with the KinD cluster it launched on the host
2225
docker run \
2326
--rm \
2427
-v /var/run/docker.sock:/var/run/docker.sock \
2528
-v "$(pwd)":"$(pwd)" \
26-
-ti \
2729
--network host \
28-
docker.pkg.github.com/kubernetes-client/java/crd-model-gen:v1.0.2 \
30+
${IMAGE_NAME}:${IMAGE_TAG} \
2931
/generate.sh \
3032
-u https://github.com/jetstack/cert-manager/releases/download/v0.16.1/cert-manager.crds.yaml \
3133
-n io.cert-manager \

client-java-contrib/prometheus-operator/update.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@
1616
# This script generates the model classes from a released version of cert-manager CRDs
1717
# under src/main/java/io/cert/manager/models.
1818

19+
IMAGE_NAME=${IMAGE_NAME:docker.pkg.github.com/kubernetes-client/java/crd-model-gen}
20+
IMAGE_TAG=${IMAGE_TAG:v1.0.2}
21+
1922
# a crdgen container is run in a way that:
2023
# 1. it has access to the docker daemon on the host so that it is able to create sibling container on the host
2124
# 2. it runs on the host network so that it is able to communicate with the KinD cluster it launched on the host
2225
docker run \
2326
--rm \
2427
-v /var/run/docker.sock:/var/run/docker.sock \
2528
-v "$(pwd)":"$(pwd)" \
26-
-ti \
2729
--network host \
28-
docker.pkg.github.com/kubernetes-client/java/crd-model-gen:v1.0.2 \
30+
${IMAGE_NAME}:${IMAGE_TAG} \
2931
/generate.sh \
3032
-u https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.38.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml \
3133
-u https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.38.1/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml \

0 commit comments

Comments
 (0)