Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use yannh/kubernetes-json-schema #76

Merged
merged 2 commits into from
Apr 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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:=23cab9da14079ad764032a4b1c6efaef6739d24b
squaremo marked this conversation as resolved.
Show resolved Hide resolved
SCHEMA_DIR:=build/raw/${KUBE_SCHEMA_REPO}-${KUBE_SCHEMA_SHA1}
COPIED_MARK:=build/.copied.${KUBE_SCHEMA_SHA1}

Expand Down Expand Up @@ -42,9 +39,10 @@ build-image: dist
cp -R @jkcfg build/image/
docker build -t jkcfg/kubernetes -f Dockerfile build/image

${SCHEMA_ZIP}:
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"
${SCHEMA_DIR}:
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 && \
git ls-tree -d -r HEAD --name-only | grep -E "v.*-local" | xargs git sparse-checkout add && \
git read-tree -mu HEAD