run make template to update templates

pull/1256/head
Jiaqi Luo 2021-06-08 13:07:41 -07:00
parent f76a8838f0
commit a6980385e1
3 changed files with 35 additions and 11 deletions

View File

@ -4,7 +4,7 @@ pull-scripts:
TARGETS := prepare patch charts clean validate template TARGETS := prepare patch charts clean validate template
$(TARGETS): $(TARGETS):
@ls ./bin/charts-build-scripts 1>/dev/null 2>/dev/null || ./scripts/pull-scripts @./scripts/pull-scripts
./bin/charts-build-scripts $@ @./bin/charts-build-scripts $@
.PHONY: $(TARGETS) .PHONY: $(TARGETS)

View File

@ -5,7 +5,8 @@
A Package represents a grouping of one or more Helm Charts. It is declared within `packages/<package>/package.yaml` with the following spec: A Package represents a grouping of one or more Helm Charts. It is declared within `packages/<package>/package.yaml` with the following spec:
```text ```text
packageVersion: 0 version: # The version of the generated chart. This value will override the upstream chart's version. Mutually exclusive with packageVersion
packageVersion: 1 # The value range is from 1 to 99. Mutually exclusive with version
workingDir: # The directory within your package that will contain your working copy of the chart (e.g. charts) workingDir: # The directory within your package that will contain your working copy of the chart (e.g. charts)
url: # A URL pointing to an UpstreamConfiguration url: # A URL pointing to an UpstreamConfiguration
subdirectory: # Optional field for a specific subdirectory for all upstreams subdirectory: # Optional field for a specific subdirectory for all upstreams

View File

@ -5,19 +5,42 @@ cd $(dirname $0)
source ./version source ./version
if ls ../bin/charts-build-scripts 1>/dev/null 2>/dev/null; then
CURRENT_SCRIPT_VERSION=$(../bin/charts-build-scripts --version | cut -d' ' -f3)
if [[ "${CURRENT_SCRIPT_VERSION}" == "${CHARTS_BUILD_SCRIPT_VERSION}" ]]; then
exit 0
fi
fi
echo "Pulling in charts-build-scripts version ${CHARTS_BUILD_SCRIPTS_REPO}@${CHARTS_BUILD_SCRIPT_VERSION}" echo "Pulling in charts-build-scripts version ${CHARTS_BUILD_SCRIPTS_REPO}@${CHARTS_BUILD_SCRIPT_VERSION}"
rm -rf ../bin rm -rf ../bin
cd .. cd ..
rm -rf charts-build-scripts mkdir -p bin
git clone --depth 1 --branch $CHARTS_BUILD_SCRIPT_VERSION $CHARTS_BUILD_SCRIPTS_REPO 2>/dev/null ARCH=$(go version | cut -d' ' -f4 | cut -d'/' -f1)
if [[ ${ARCH} == "linux" ]]; then
BINARY_NAME=charts-build-scripts
else
BINARY_NAME=charts-build-scripts-${ARCH}
fi
curl -s -L ${CHARTS_BUILD_SCRIPTS_REPO%.git}/releases/download/${CHARTS_BUILD_SCRIPT_VERSION}/${BINARY_NAME} --output bin/charts-build-scripts
if ! [[ -f bin/charts-build-scripts ]] || [[ $(cat bin/charts-build-scripts) == "Not Found" ]]; then
rm bin/charts-build-scripts;
# Fall back to old process
echo "Building binary locally..."
rm -rf charts-build-scripts
git clone --depth 1 --branch $CHARTS_BUILD_SCRIPT_VERSION $CHARTS_BUILD_SCRIPTS_REPO 2>/dev/null
cd charts-build-scripts cd charts-build-scripts
./scripts/build ./scripts/build
mv bin ../bin mv bin ..
cd .. cd ..
rm -rf charts-build-scripts
else
echo "${BINARY_NAME} => ./bin/charts-build-scripts"
fi
rm -rf charts-build-scripts
chmod +x ./bin/charts-build-scripts chmod +x ./bin/charts-build-scripts
./bin/charts-build-scripts --version ./bin/charts-build-scripts --version