mirror of https://git.rancher.io/charts
[release-v2.8] Update build scripts to 0.9.5 (#4224)
parent
d2f598e94b
commit
2d27a4858d
5
Makefile
5
Makefile
|
@ -1,3 +1,6 @@
|
|||
help:
|
||||
./bin/charts-build-scripts --help
|
||||
|
||||
pull-scripts:
|
||||
./scripts/pull-scripts
|
||||
|
||||
|
@ -14,7 +17,7 @@ validate:
|
|||
@./scripts/pull-scripts
|
||||
@./bin/charts-build-scripts validate $(if $(filter true,$(remote)),--remote) $(if $(filter true,$(local)),--local)
|
||||
|
||||
TARGETS := prepare patch clean clean-cache charts list index unzip zip standardize template regsync check-images check-rc enforce-lifecycle lifecycle-status
|
||||
TARGETS := prepare patch clean clean-cache charts list index unzip zip standardize template regsync check-images check-rc enforce-lifecycle lifecycle-status auto-forward-port
|
||||
|
||||
$(TARGETS):
|
||||
@./scripts/pull-scripts
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -e # Exit immediately if a command exits with a non-zero status.
|
||||
|
||||
cd $(dirname $0)
|
||||
|
||||
source ./version
|
||||
cd $(dirname $0) # Move to the directory of the script
|
||||
source ./version # Source the version file to set environment variables
|
||||
|
||||
# Check if the charts-build-scripts binary exists in the ../bin directory
|
||||
if ls ../bin/charts-build-scripts 1>/dev/null 2>/dev/null; then
|
||||
CURRENT_SCRIPT_VERSION=$(../bin/charts-build-scripts --version | cut -d' ' -f3)
|
||||
# Use awk to split the version output correctly and extract the version number
|
||||
CURRENT_SCRIPT_VERSION="v$(../bin/charts-build-scripts --version | awk '{print $3}')"
|
||||
echo "Current version: ${CURRENT_SCRIPT_VERSION}, Expected version: ${CHARTS_BUILD_SCRIPT_VERSION}"
|
||||
# Exit if the current version matches the expected version
|
||||
if [[ "${CURRENT_SCRIPT_VERSION}" == "${CHARTS_BUILD_SCRIPT_VERSION}" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
@ -14,29 +17,37 @@ fi
|
|||
|
||||
echo "Downloading charts-build-scripts version ${CHARTS_BUILD_SCRIPTS_REPO}@${CHARTS_BUILD_SCRIPT_VERSION}"
|
||||
|
||||
# Remove existing ../bin directory and change to the parent dir.
|
||||
rm -rf ../bin
|
||||
cd ..
|
||||
|
||||
mkdir -p bin
|
||||
mkdir -p bin # Re-create bin dir
|
||||
|
||||
# Extract the OS and architecture from the go version command output
|
||||
OS=$(go version | cut -d' ' -f4 | cut -d'/' -f1)
|
||||
ARCH=$(go version | cut -d' ' -f4 | cut -d'/' -f2)
|
||||
|
||||
# Determine the binary name based on the OS and architecture
|
||||
if [[ "$OS" == "windows" ]]; then
|
||||
BINARY_NAME="charts-build-scripts_${OS}_${ARCH}.exe"
|
||||
else
|
||||
BINARY_NAME="charts-build-scripts_${OS}_${ARCH}"
|
||||
fi
|
||||
|
||||
# Download the binary from the charts-build-scripts repository
|
||||
curl -s -L ${CHARTS_BUILD_SCRIPTS_REPO%.git}/releases/download/${CHARTS_BUILD_SCRIPT_VERSION}/${BINARY_NAME} --output bin/charts-build-scripts
|
||||
|
||||
# Fall back to binary name format from old release scheme
|
||||
# If the binary is not found or contains "Not Found", Fall back to binary name format from old release scheme
|
||||
if ! [[ -f bin/charts-build-scripts ]] || [[ $(cat bin/charts-build-scripts) == "Not Found" ]]; then
|
||||
echo "Falling back to old binary name format..."
|
||||
rm bin/charts-build-scripts;
|
||||
rm bin/charts-build-scripts; # Remove the not found old binary
|
||||
# Determine the fallback binary name.
|
||||
if [[ ${OS} == "linux" ]]; then
|
||||
BINARY_NAME=charts-build-scripts
|
||||
else
|
||||
BINARY_NAME=charts-build-scripts-${OS}
|
||||
fi
|
||||
# Attempt to download the binary using the fallback name.
|
||||
curl -s -L ${CHARTS_BUILD_SCRIPTS_REPO%.git}/releases/download/${CHARTS_BUILD_SCRIPT_VERSION}/${BINARY_NAME} --output bin/charts-build-scripts
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
## Charts Checklist (built for v0.8.x charts-build-scripts)
|
||||
## Charts Checklist (built for v0.9.x charts-build-scripts)
|
||||
|
||||
### Checkpoint 0: Validate `release.yaml`
|
||||
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
set -e
|
||||
|
||||
CHARTS_BUILD_SCRIPTS_REPO=https://github.com/rancher/charts-build-scripts.git
|
||||
CHARTS_BUILD_SCRIPT_VERSION="${CHARTS_BUILD_SCRIPT_VERSION:-v0.9.2}"
|
||||
CHARTS_BUILD_SCRIPT_VERSION="${CHARTS_BUILD_SCRIPT_VERSION:-v0.9.5}"
|
||||
|
|
Loading…
Reference in New Issue