From 2538eb38aada86c9caafe030769e61b0961569e3 Mon Sep 17 00:00:00 2001 From: Adnaan Badr Date: Sun, 28 Mar 2021 12:26:18 +0200 Subject: [PATCH 1/2] Use yannh/kubernetes-json-schema --- Makefile | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 0b3dd98..2166844 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,6 @@ -KUBE_SCHEMA_ORG:=jkcfg -KUBE_SCHEMA_REPO:=kubernetes-schema -KUBE_SCHEMA_SHA1:=83d92a798500efd744a576df994196e75f3133dd -SCHEMA_ZIP:=build/${KUBE_SCHEMA_ORG}-${KUBE_SCHEMA_REPO}-${KUBE_SCHEMA_SHA1}.zip -# the next one is a consequence of how the zip file is made: the files -# will be in a directory named for the repo and commit hash. +KUBE_SCHEMA_ORG:=yannh +KUBE_SCHEMA_REPO:=kubernetes-json-schema +KUBE_SCHEMA_SHA1:=master SCHEMA_DIR:=build/raw/${KUBE_SCHEMA_REPO}-${KUBE_SCHEMA_SHA1} COPIED_MARK:=build/.copied.${KUBE_SCHEMA_SHA1} @@ -42,9 +39,10 @@ build-image: dist cp -R @jkcfg build/image/ docker build -t jkcfg/kubernetes -f Dockerfile build/image -${SCHEMA_ZIP}: +${SCHEMA_DIR}: mkdir build - curl -L -o "$@" "https://github.com/${KUBE_SCHEMA_ORG}/${KUBE_SCHEMA_REPO}/archive/${KUBE_SCHEMA_SHA1}.zip" - -${SCHEMA_DIR}: ${SCHEMA_ZIP} - unzip -q ${SCHEMA_ZIP} -d build/raw/ "${KUBE_SCHEMA_REPO}-${KUBE_SCHEMA_SHA1}/*-local/*.json" + git clone --depth 1 --no-checkout "https://github.com/${KUBE_SCHEMA_ORG}/${KUBE_SCHEMA_REPO}" ${SCHEMA_DIR} + cd ${SCHEMA_DIR} && \ + git sparse-checkout init --cone && \ + git ls-tree -d -r HEAD --name-only | grep -E "v.*-local" | xargs git sparse-checkout add && \ + git read-tree -mu HEAD From ef043ed24c9ec97c6f2786237b9da4b09abb3fa1 Mon Sep 17 00:00:00 2001 From: Adnaan Badr Date: Tue, 30 Mar 2021 17:16:36 +0200 Subject: [PATCH 2/2] use commit sha instead of branch name, ensure mkdir --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2166844..019a410 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ KUBE_SCHEMA_ORG:=yannh KUBE_SCHEMA_REPO:=kubernetes-json-schema -KUBE_SCHEMA_SHA1:=master +KUBE_SCHEMA_SHA1:=23cab9da14079ad764032a4b1c6efaef6739d24b SCHEMA_DIR:=build/raw/${KUBE_SCHEMA_REPO}-${KUBE_SCHEMA_SHA1} COPIED_MARK:=build/.copied.${KUBE_SCHEMA_SHA1} @@ -40,7 +40,7 @@ build-image: dist docker build -t jkcfg/kubernetes -f Dockerfile build/image ${SCHEMA_DIR}: - mkdir build + mkdir -p build git clone --depth 1 --no-checkout "https://github.com/${KUBE_SCHEMA_ORG}/${KUBE_SCHEMA_REPO}" ${SCHEMA_DIR} cd ${SCHEMA_DIR} && \ git sparse-checkout init --cone && \