Updating Makefile to use CI validate. Existing validate will fail if any packages subdirectory lacks package.yaml

pull/501/head
Samuel Attwood 2022-08-22 05:22:40 -04:00
parent 7e0026c72d
commit e1df82c46f
2 changed files with 43 additions and 2 deletions

View File

@ -1,10 +1,14 @@
pull-scripts:
./scripts/pull-scripts
TARGETS := prepare patch charts clean validate template
TARGETS := prepare patch charts clean template
validate:
@./scripts/pull-ci-scripts
@./bin/partner-charts-ci validate
$(TARGETS):
@./scripts/pull-scripts
@./bin/charts-build-scripts $@
.PHONY: $(TARGETS)
.PHONY: $(TARGETS) validate

37
scripts/pull-ci-scripts Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
set -e
CI_BINARY="partner-charts-ci"
CI_BINARY_URL_BASE="https://github.com/samuelattwood/partner-charts-ci/releases/latest/download"
CI_GIT_REPO="https://github.com/samuelattwood/partner-charts-ci.git"
mkdir -p bin
if [[ -f bin/${CI_BINARY} ]]; then
echo "bin/${CI_BINARY} exists. Skipping fetch..."
exit 0
fi
OS=$(uname -s)
ARCH=$(uname -p)
if [[ ${OS} == "Linux" ]] && [[ ${ARCH} == "x86_64" ]]; then
BINARY_NAME=partner-charts-ci-linux-amd64
elif [[ ${OS} == "Darwin" ]]; then
BINARY_NAME=partner-charts-ci-darwin-universal
else
#Fall back to local build
git clone --depth 1 -b main ${CI_GIT_REPO} src
cd src
make
mv bin/${CI_BINARY} ../bin
cd ..
rm -rf src
fi
if [[ ! -z ${BINARY_NAME} ]]; then
curl -s -L -o bin/${CI_BINARY} ${CI_BINARY_URL_BASE}/${BINARY_NAME}
fi
chmod +x bin/partner-charts-ci