Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prod-v2.8] Update scripts/pull-scripts to use new release scheme #4047

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,50 @@
elemental:
- 103.3.0+up1.5.3
elemental-crd:
- 103.3.0+up1.5.3
fleet:
- 102.2.5+up0.8.5
- 103.1.5+up0.9.5
fleet-agent:
- 102.2.5+up0.8.5
- 103.1.5+up0.9.5
fleet-crd:
- 102.2.5+up0.8.5
- 103.1.5+up0.9.5
longhorn:
- 102.4.1+up1.6.2
- 103.3.1+up1.6.2
longhorn-crd:
- 102.4.1+up1.6.2
- 103.3.1+up1.6.2
prometheus-federator:
- 103.0.2+up0.4.0
- 3.0.2+up0.3.3
rancher-aks-operator:
- 103.2.0+up1.2.2
rancher-aks-operator-crd:
- 103.2.0+up1.2.2
rancher-alerting-drivers:
- 102.1.2
rancher-eks-operator:
- 103.2.0+up1.3.2
rancher-eks-operator-crd:
- 103.2.0+up1.3.2
rancher-gatekeeper:
- 102.1.2+up3.13.0
- 103.2.0+up3.13.0
rancher-gatekeeper-crd:
- 102.1.2+up3.13.0
- 103.2.0+up3.13.0
rancher-gke-operator:
- 103.2.0+up1.2.2
rancher-gke-operator-crd:
- 103.2.0+up1.2.2
rancher-istio:
- 103.3.0+up1.21.1
rancher-monitoring:
- 102.0.5+up40.1.2
- 103.1.1+up45.31.1
rancher-monitoring-crd:
- 102.0.5+up40.1.2
- 103.1.1+up45.31.1
43 changes: 25 additions & 18 deletions scripts/pull-scripts
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,42 @@ if ls ../bin/charts-build-scripts 1>/dev/null 2>/dev/null; then
fi
fi

echo "Pulling in charts-build-scripts version ${CHARTS_BUILD_SCRIPTS_REPO}@${CHARTS_BUILD_SCRIPT_VERSION}"
echo "Downloading charts-build-scripts version ${CHARTS_BUILD_SCRIPTS_REPO}@${CHARTS_BUILD_SCRIPT_VERSION}"

rm -rf ../bin
cd ..

mkdir -p bin
ARCH=$(go version | cut -d' ' -f4 | cut -d'/' -f1)
if [[ ${ARCH} == "linux" ]]; then
BINARY_NAME=charts-build-scripts
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-${ARCH}
BINARY_NAME="charts-build-scripts_${OS}_${ARCH}"
fi
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 ! [[ -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;

# 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 charts-build-scripts 2>/dev/null

cd charts-build-scripts
VERSION_OVERRIDE=${CHARTS_BUILD_SCRIPT_VERSION} ./scripts/build
mv bin ..
cd ..
rm -rf charts-build-scripts
else
echo "${BINARY_NAME} => ./bin/charts-build-scripts"
if [[ ${OS} == "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
fi

# If falling back to old binary name format did not work, fail
if ! [[ -f bin/charts-build-scripts ]] || [[ $(cat bin/charts-build-scripts) == "Not Found" ]]; 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