Skip to content

Commit

Permalink
ci: Updated generated code validations
Browse files Browse the repository at this point in the history
  • Loading branch information
manusa committed May 4, 2021
1 parent efd92aa commit 03c5e55
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
./kubernetes-model-generator/generateModelDocker.sh
- name: Check No Schema file modified
run: |
git status
MODIFIED_KUBE_SCHEMA=`git status | grep kube-schema.json | wc -l`
git add .
MODIFIED_KUBE_SCHEMA=`git status | grep 'kube-schema.json\|src/generated/java' | wc -l`
if [ $MODIFIED_KUBE_SCHEMA -eq "0" ]; then
echo "No Schema files modified. Build Success.";
else
Expand Down
5 changes: 5 additions & 0 deletions kubernetes-model-generator/generateModel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ generateSingleModule() {
cd "$ABSOLUTE_BASEDIR" || exit 1
}

echo "Installing required common modules"
mvn clean install -f ../pom.xml -N
mvn clean install -N
mvn clean install -pl kubernetes-model-common -pl kubernetes-model-jsonschema2pojo

if [ -z "$1" ]; then
generateAll
else
Expand Down
4 changes: 2 additions & 2 deletions kubernetes-model-generator/generateModelDocker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
set -e

BASEDIR=$(dirname "$BASH_SOURCE")
ABSOLUTE_BASEDIR=$(realpath "$BASEDIR")
ABSOLUTE_BASEDIR=$(realpath "$BASEDIR/..")

DOCKER_IMAGE_GOLANG=marcnuri/golang-1.15-java11

docker run \
--rm \
-v "$ABSOLUTE_BASEDIR":/usr/src/kubernetes-model-generator \
-v "$ABSOLUTE_BASEDIR":/usr/src \
-w /usr/src/kubernetes-model-generator \
-e LOCAL_USER="$(id -u):$(id -g)" \
$DOCKER_IMAGE_GOLANG "./generateModel.sh" "$@"

0 comments on commit 03c5e55

Please sign in to comment.