Skip to content

Commit

Permalink
adding charts related scripts and export-config
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasSUSE committed Aug 13, 2024
1 parent 2a673c1 commit f14d211
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
15 changes: 14 additions & 1 deletion scripts/build-crds
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
#! /bin/sh
#! /bin/bash

while [[ $# -gt 0 ]]; do
case "$1" in
-q|--quiet)
QUIET=true
shift
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done

cd $(dirname $0)/../

Expand Down
1 change: 1 addition & 0 deletions scripts/chart/build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ echo "-- chart/build --"

cd $(dirname $0)/..
. ./version
. ./export-config

cd ..
mkdir -p build/chart
Expand Down
4 changes: 2 additions & 2 deletions scripts/chart/test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ -z "$(type -p helm_v3)" ]; then
exit 1
fi

if [ "${ARCH}" != "amd64" ]; then
if [ "${ARCH}" != "amd64" ]; then
echo "${ARCH} is not supported for chart tests, chart tests won't run"
exit 0
fi
Expand All @@ -21,6 +21,6 @@ if [[ $? > 0 ]]; then
fi

current_dir=$(pwd)
cd ../../build/chart/rancher
cd $(dirname $0)/../../build/chart/rancher
helm_v3 unittest ./
cd $current_dir
19 changes: 19 additions & 0 deletions scripts/export-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -e

if [ -n "$DEBUG" ]; then
set -x
fi

file="$(git rev-parse --show-toplevel)/build.yaml"

CATTLE_RANCHER_WEBHOOK_VERSION=$(yq -e '.webhookVersion' "$file")
CATTLE_CSP_ADAPTER_MIN_VERSION=$(yq -e '.cspAdapterMinVersion' "$file")
CATTLE_DEFAULT_SHELL_VERSION=$(yq -e '.defaultShellVersion' "$file")
CATTLE_FLEET_VERSION=$(yq -e '.fleetVersion' "$file")

export CATTLE_RANCHER_WEBHOOK_VERSION
export CATTLE_CSP_ADAPTER_MIN_VERSION
export CATTLE_DEFAULT_SHELL_VERSION
export CATTLE_FLEET_VERSION

0 comments on commit f14d211

Please sign in to comment.