mirror of https://git.rancher.io/charts
[dev-v2.9] Update build scripts (#4222)
parent
e22b1ceebc
commit
4441a146f7
5
Makefile
5
Makefile
|
@ -1,3 +1,6 @@
|
||||||
|
help:
|
||||||
|
./bin/charts-build-scripts --help
|
||||||
|
|
||||||
pull-scripts:
|
pull-scripts:
|
||||||
./scripts/pull-scripts
|
./scripts/pull-scripts
|
||||||
|
|
||||||
|
@ -14,7 +17,7 @@ validate:
|
||||||
@./scripts/pull-scripts
|
@./scripts/pull-scripts
|
||||||
@./bin/charts-build-scripts validate $(if $(filter true,$(remote)),--remote) $(if $(filter true,$(local)),--local)
|
@./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):
|
$(TARGETS):
|
||||||
@./scripts/pull-scripts
|
@./scripts/pull-scripts
|
||||||
|
|
16
README.md
16
README.md
|
@ -26,20 +26,20 @@ This repository contains Helm charts served by Rancher Apps & Marketplace.
|
||||||
### New Out Of Band Release Process
|
### New Out Of Band Release Process
|
||||||
Starting on `17/May/2024`.
|
Starting on `17/May/2024`.
|
||||||
|
|
||||||
This is only valid for `prod-v2.*` branches.
|
This is only valid for `release-v2.*` branches.
|
||||||
Since this implementation, all teams may release each chart when they want.
|
Since this implementation, all teams may release each chart when they want.
|
||||||
|
|
||||||
##### Overview of the process:
|
##### Overview of the process:
|
||||||
1. Assuming you have a chart ready and merged on `dev-v2.*` branch.
|
1. Assuming you have a chart ready and merged on `dev-v2.*` branch.
|
||||||
2. On your local machine: `fetch`, `pull` and `checkout` to `prod-v2.*`
|
2. On your local machine: `fetch`, `pull` and `checkout` to `release-v2.*`
|
||||||
3. Create a new branch from `prod-v2.*`
|
3. Create a new branch from `release-v2.*`
|
||||||
4. Execute `make forward-port`
|
4. Execute `make forward-port`
|
||||||
5. Clear your `release.yaml` file, leave only your chart that will be released
|
5. Clear your `release.yaml` file, leave only your chart that will be released
|
||||||
6. Add, Commit and push your changes to your forked repository
|
6. Add, Commit and push your changes to your forked repository
|
||||||
|
|
||||||
**Attention**: If you have a CRD that must be released with the chart, you should repeat `Step 4.` until `Step 6.` for the CRD chart.
|
**Attention**: If you have a CRD that must be released with the chart, you should repeat `Step 4.` until `Step 6.` for the CRD chart.
|
||||||
|
|
||||||
7. Create a Pull Request from your forked repository to `rancher/charts` pointing to `prod-v2.*`
|
7. Create a Pull Request from your forked repository to `rancher/charts` pointing to `release-v2.*`
|
||||||
|
|
||||||
|
|
||||||
##### How to use `forward-port`:
|
##### How to use `forward-port`:
|
||||||
|
@ -63,7 +63,7 @@ Script Arguments Reference:
|
||||||
make forward-port CHART=rancher-istio VERSION=103.3.0+up1.21.1 BRANCH=dev-v2.8 UPSTREAM=upstream
|
make forward-port CHART=rancher-istio VERSION=103.3.0+up1.21.1 BRANCH=dev-v2.8 UPSTREAM=upstream
|
||||||
```
|
```
|
||||||
|
|
||||||
In this case, we are at branch `prod-v2.8`, we have a new version of Istio at `dev-v2.8`.
|
In this case, we are at branch `release-v2.8`, we have a new version of Istio at `dev-v2.8`.
|
||||||
|
|
||||||
The script will get all necessary changes for `assets`, `charts`, `release.yaml` and `index.yaml` and handle them all automatically.
|
The script will get all necessary changes for `assets`, `charts`, `release.yaml` and `index.yaml` and handle them all automatically.
|
||||||
|
|
||||||
|
@ -87,9 +87,9 @@ We will keep only the relevant assets in the corresponding branch.
|
||||||
This means a cycle of always 3 active branches, with each branch always holding up to 2 previous versions before it.
|
This means a cycle of always 3 active branches, with each branch always holding up to 2 previous versions before it.
|
||||||
|
|
||||||
In a nutshell:
|
In a nutshell:
|
||||||
- prod-v2.7 hold chart versions for Rancher: (2.5; 2.6; 2.7)
|
- release-v2.7 hold chart versions for Rancher: (2.5; 2.6; 2.7)
|
||||||
- prod-v2.8 hold chart versions for Rancher: (2.6; 2.7; 2.8)
|
- release-v2.8 hold chart versions for Rancher: (2.6; 2.7; 2.8)
|
||||||
- prod-v2.9 hold chart versions for Rancher: (2.7; 2.8; 2.9)
|
- release-v2.9 hold chart versions for Rancher: (2.7; 2.8; 2.9)
|
||||||
|
|
||||||
![Assets Lifecycle](./docs/assets_lifecycle.png)
|
![Assets Lifecycle](./docs/assets_lifecycle.png)
|
||||||
|
|
||||||
|
|
|
@ -3,4 +3,4 @@ helmRepo:
|
||||||
|
|
||||||
validate:
|
validate:
|
||||||
url: https://github.com/rancher/charts.git
|
url: https://github.com/rancher/charts.git
|
||||||
branch: prod-v2.9
|
branch: release-v2.9
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e # Exit immediately if a command exits with a non-zero status.
|
||||||
|
|
||||||
cd $(dirname $0)
|
cd $(dirname $0) # Move to the directory of the script
|
||||||
|
source ./version # Source the version file to set environment variables
|
||||||
source ./version
|
|
||||||
|
|
||||||
|
# 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
|
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
|
if [[ "${CURRENT_SCRIPT_VERSION}" == "${CHARTS_BUILD_SCRIPT_VERSION}" ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -14,29 +17,37 @@ fi
|
||||||
|
|
||||||
echo "Downloading 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}"
|
||||||
|
|
||||||
|
# Remove existing ../bin directory and change to the parent dir.
|
||||||
rm -rf ../bin
|
rm -rf ../bin
|
||||||
cd ..
|
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)
|
OS=$(go version | cut -d' ' -f4 | cut -d'/' -f1)
|
||||||
ARCH=$(go version | cut -d' ' -f4 | cut -d'/' -f2)
|
ARCH=$(go version | cut -d' ' -f4 | cut -d'/' -f2)
|
||||||
|
|
||||||
|
# Determine the binary name based on the OS and architecture
|
||||||
if [[ "$OS" == "windows" ]]; then
|
if [[ "$OS" == "windows" ]]; then
|
||||||
BINARY_NAME="charts-build-scripts_${OS}_${ARCH}.exe"
|
BINARY_NAME="charts-build-scripts_${OS}_${ARCH}.exe"
|
||||||
else
|
else
|
||||||
BINARY_NAME="charts-build-scripts_${OS}_${ARCH}"
|
BINARY_NAME="charts-build-scripts_${OS}_${ARCH}"
|
||||||
fi
|
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
|
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
|
if ! [[ -f bin/charts-build-scripts ]] || [[ $(cat bin/charts-build-scripts) == "Not Found" ]]; then
|
||||||
echo "Falling back to old binary name format..."
|
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
|
if [[ ${OS} == "linux" ]]; then
|
||||||
BINARY_NAME=charts-build-scripts
|
BINARY_NAME=charts-build-scripts
|
||||||
else
|
else
|
||||||
BINARY_NAME=charts-build-scripts-${OS}
|
BINARY_NAME=charts-build-scripts-${OS}
|
||||||
fi
|
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
|
curl -s -L ${CHARTS_BUILD_SCRIPTS_REPO%.git}/releases/download/${CHARTS_BUILD_SCRIPT_VERSION}/${BINARY_NAME} --output bin/charts-build-scripts
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -50,4 +61,4 @@ fi
|
||||||
echo "${BINARY_NAME} => ./bin/charts-build-scripts"
|
echo "${BINARY_NAME} => ./bin/charts-build-scripts"
|
||||||
|
|
||||||
chmod +x ./bin/charts-build-scripts
|
chmod +x ./bin/charts-build-scripts
|
||||||
./bin/charts-build-scripts --version
|
./bin/charts-build-scripts --version
|
|
@ -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`
|
### Checkpoint 0: Validate `release.yaml`
|
||||||
|
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
CHARTS_BUILD_SCRIPTS_REPO=https://github.com/rancher/charts-build-scripts.git
|
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