diff --git a/.github/scripts/aisix-config-boot.sh b/.github/scripts/aisix-config-boot.sh new file mode 100755 index 0000000..32c5008 --- /dev/null +++ b/.github/scripts/aisix-config-boot.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash +# Boot the gateway image the chart deploys (its appVersion) on the config file +# the chart renders, in both modes, with charts/aisix/ci/config-values.yaml +# setting list-typed keys through `config`. +# +# Standalone must come up and answer /livez. Control-plane mode has no control +# plane to reach here, so it must get past loading the config file and fail +# only once it acts on the connection. Override the image with AISIX_IMAGE. +set -euo pipefail + +chart=charts/aisix +app=$(awk '/^appVersion:/ {gsub(/"/, "", $2); print $2}' "$chart/Chart.yaml") +image=${AISIX_IMAGE:-docker.io/api7/aisix:$app} +work=$(mktemp -d) +chmod 755 "$work" +run_id=$$ +trap 'docker rm -f "aisix-cfgboot-standalone-$run_id" "aisix-cfgboot-managed-$run_id" >/dev/null 2>&1 || true; rm -rf "$work"' EXIT + +# extract