Skip to content

Commit

Permalink
chore: updated makefile rules for schema generation
Browse files Browse the repository at this point in the history
Explicit model generation is no longer needed

Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa authored Oct 7, 2024
1 parent ac775cf commit 455d43e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
java-version: '8'
distribution: 'temurin'
- name: Install Kubernetes Client
run: ./mvnw ${MAVEN_ARGS} clean install -DskipTests -Djacoco.skip=true
run: make quickly MAVEN_ARGS="${MAVEN_ARGS}"

minikube_baremetal:
name: Baremetal K8S
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

name: Sonar Scanner

env:
MAVEN_OPTIONS: -B -C -V -ntp -Dhttp.keepAlive=false -e

on:
push:
branches:
Expand Down Expand Up @@ -56,4 +53,4 @@ jobs:
java-version: '17'
distribution: 'temurin'
- name: Sonar
run: make clean sonar
run: make sonar
65 changes: 20 additions & 45 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
# limitations under the License.
#

MAVEN_OPTIONS ?=
.DEFAULT_GOAL := quickly
MAVEN_ARGS ?=
override MAVEN_ARGS += -T 1C
OPENAPI_DIR=$(realpath ./kubernetes-model-generator/openapi)
OPENAPI_GENERATOR_DIR=$(OPENAPI_DIR)/generator
OPENAPI_GENERATOR_BINARY_NAME=generator
Expand All @@ -23,7 +25,7 @@ OPENAPI_SCHEMAS_DIR=$(OPENAPI_DIR)/schemas

.PHONY: clean-java
clean-java:
mvn $(MAVEN_OPTIONS) clean
mvn $(MAVEN_ARGS) clean

.PHONY: clean
clean: clean-java
Expand All @@ -38,47 +40,7 @@ openapi-generate-schema:

.PHONY: openapi-generate-java-classes
openapi-generate-java-classes:
# TODO: Do for all modules once they've all been migrated
# cd kubernetes-model-generator && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-common && mvn clean install
cd kubernetes-model-generator/openapi/maven-plugin && mvn clean verify
cd kubernetes-model-generator/kubernetes-model-core && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-rbac && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-admissionregistration && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-apiextensions && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-apps && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-autoscaling && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-batch && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-certificates && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-coordination && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-discovery && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-events && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-extensions && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-flowcontrol && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-gatewayapi && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-networking && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-metrics && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-node && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-policy && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-scheduling && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-storageclass && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-resource && mvn -Pgenerate clean install
cd kubernetes-model-generator/kubernetes-model-kustomize && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-config && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-operator && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-miscellaneous && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-operatorhub && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-console && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-autoscaling && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-machine && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-machineconfiguration && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-monitoring && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-tuned && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-whereabouts && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-storageversionmigrator && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-hive && mvn -Pgenerate clean install
cd kubernetes-model-generator/openshift-model-installer && mvn -Pgenerate clean install
cd kubernetes-model-generator && mvn $(MAVEN_ARGS) -Pgenerate clean install

# Legacy generation of the model: TODO: remove
.PHONY: generate-model-legacy
Expand All @@ -89,5 +51,18 @@ generate-model-legacy:
generate-model: openapi-generate-schema openapi-generate-java-classes generate-model-legacy

.PHONY: sonar
sonar:
mvn $(MAVEN_OPTIONS) clean install sonar:sonar -Psonar
sonar: clean
# $(MAVEN_ARGS) ---> -T 1C won't work with sonar analysis (yet)
mvn -Psonar install sonar:sonar

.PHONY: format-license
format-license:
mvn $(MAVEN_ARGS) -N license:format

.PHONY: format-java
format-java:
mvn $(MAVEN_ARGS) spotless:apply -Pitests

.PHONY:
quickly: clean
mvn $(MAVEN_ARGS) install -DskipTests -Djacoco.skip=true

0 comments on commit 455d43e

Please sign in to comment.