diff --git a/scripts/pull-scripts b/scripts/pull-scripts deleted file mode 100755 index eb4c3cd3..00000000 --- a/scripts/pull-scripts +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash -set -e - -cd $(dirname $0) - -source ./version - -if ls ../bin/charts-build-scripts 1>/dev/null 2>/dev/null; then - CURRENT_SCRIPT_VERSION="v$(../bin/charts-build-scripts --version | cut -d' ' -f3)" - if [[ "${CURRENT_SCRIPT_VERSION}" == "${CHARTS_BUILD_SCRIPT_VERSION}" ]]; then - exit 0 - fi -fi - -echo "Downloading charts-build-scripts version ${CHARTS_BUILD_SCRIPTS_REPO}@${CHARTS_BUILD_SCRIPT_VERSION}" - -rm -rf ../bin -cd .. - -mkdir -p bin -OS=$(go version | cut -d' ' -f4 | cut -d'/' -f1) -ARCH=$(go version | cut -d' ' -f4 | cut -d'/' -f2) - -if [[ "$OS" == "windows" ]]; then - BINARY_NAME="charts-build-scripts_${OS}_${ARCH}.exe" -else - BINARY_NAME="charts-build-scripts_${OS}_${ARCH}" -fi -response_code=$(curl -s -o bin/charts-build-scripts -w "%{http_code}" -L "${CHARTS_BUILD_SCRIPTS_REPO%.git}/releases/download/${CHARTS_BUILD_SCRIPT_VERSION}/${BINARY_NAME}") - -# Fall back to binary name format from old release scheme -if ! [[ -f bin/charts-build-scripts ]] || [[ "$response_code" == "404" ]]; then - echo "Falling back to old binary name format..." - rm bin/charts-build-scripts; - if [[ ${OS} == "linux" ]]; then - BINARY_NAME=charts-build-scripts - else - BINARY_NAME=charts-build-scripts-${OS} - fi - response_code=$(curl -s -o bin/charts-build-scripts -w "%{http_code}" -L "${CHARTS_BUILD_SCRIPTS_REPO%.git}/releases/download/${CHARTS_BUILD_SCRIPT_VERSION}/${BINARY_NAME}") -fi - -# If falling back to old binary name format did not work, fail -if ! [[ -f bin/charts-build-scripts ]] || [[ "$response_code" == "404" ]]; then - echo "Failed to find charts-build-scripts binary" - rm bin/charts-build-scripts; - exit 1 -fi - -echo "${BINARY_NAME} => ./bin/charts-build-scripts" - -chmod +x ./bin/charts-build-scripts -./bin/charts-build-scripts --version \ No newline at end of file diff --git a/scripts/util-team-charts b/scripts/util-team-charts index 07bfb5a5..7793cb37 100644 --- a/scripts/util-team-charts +++ b/scripts/util-team-charts @@ -52,8 +52,9 @@ function fetch-team-chart() { BASE_FETCH_URL="https://raw.githubusercontent.com/mallardduck/ob-team-charts/refs/heads/main/assets" CHART_VERSION="${2}" FETCH_URL="${BASE_FETCH_URL}/${CHART_TARGET}/${CHART_TARGET}-${CHART_VERSION}.tgz" - BUILD_DIR="./build" - LOCAL_FILE="$BUILD_DIR/charts/${CHART_TARGET}-${CHART_VERSION}.tgz" + BUILD_DIR="./build/charts" + mkdir -p "$BUILD_DIR" + LOCAL_FILE="$BUILD_DIR/${CHART_TARGET}-${CHART_VERSION}.tgz" LOCAL_ETAG_FILE="$LOCAL_FILE.etag" # Ensure the build directory exists diff --git a/scripts/validate-charts b/scripts/validate-charts deleted file mode 100755 index 0ddd53fe..00000000 --- a/scripts/validate-charts +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -set -e - -cd $(dirname $0)/.. - -echo Running general chart validation - -./scripts/pull-scripts -./bin/charts-build-scripts validate --local \ No newline at end of file diff --git a/scripts/version b/scripts/version index 73aa7a8c..14000f94 100755 --- a/scripts/version +++ b/scripts/version @@ -1,8 +1,5 @@ #!/usr/bin/env bash -CHARTS_BUILD_SCRIPTS_REPO=https://github.com/rancher/charts-build-scripts.git -CHARTS_BUILD_SCRIPT_VERSION=v0.9.2 - BUILD_TARGET=${BUILD_TARGET:-"prometheus-federator"} if [ -n "$(git status --porcelain --untracked-files=no)" ]; then