Skip to content
Open
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
34 changes: 19 additions & 15 deletions .github/workflows/release-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,31 @@ jobs:
fi
echo "next=$VERSION" >> $GITHUB_OUTPUT

- name: Update helm values file
uses: mikefarah/yq@master
- name: Validate LATEST_RELEASE matches release version
env:
GIT_TAG: ${{ steps.semver.outputs.next }}
with:
cmd: |
yq -i '.clusterForge.targetRevision = env(GIT_TAG)' root/values.yaml
yq -i '.targetRevision = env(GIT_TAG)' scripts/init-gitea-job/values.yaml

- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v4
env:
GIT_TAG: ${{ steps.semver.outputs.next }}
with:
commit_message: 'Update version to ${{ env.GIT_TAG }} [actions skip]'
VERSION: ${{ steps.semver.outputs.next }}
run: |
# Extract LATEST_RELEASE from bootstrap.sh
LATEST_RELEASE=$(grep '^LATEST_RELEASE=' scripts/bootstrap.sh | cut -d'"' -f2 | sed 's/^v//')

# Extract base version (before -rc or -alpha, etc.)
RELEASE_BASE=$(echo "$VERSION" | sed 's/^v//' | sed 's/-rc[0-9]*$//' | sed 's/-alpha[0-9]*$//' | sed 's/-beta[0-9]*$//')
LATEST_BASE=$(echo "$LATEST_RELEASE" | sed 's/-rc[0-9]*$//' | sed 's/-alpha[0-9]*$//' | sed 's/-beta[0-9]*$//')

echo "Release version: $VERSION (base: $RELEASE_BASE)"
echo "LATEST_RELEASE in bootstrap.sh: $LATEST_RELEASE (base: $LATEST_BASE)"

if [[ "$RELEASE_BASE" != "$LATEST_BASE" ]]; then
echo "::warning::LATEST_RELEASE base version ($LATEST_BASE) in scripts/bootstrap.sh does not match release version base ($RELEASE_BASE)"
echo "::warning::Consider updating LATEST_RELEASE in scripts/bootstrap.sh to match the release being created"
else
echo "✓ LATEST_RELEASE base version matches release version base"
fi

- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.semver.outputs.next }}
EXTRA_ARGS: ${{ steps.version.outputs.extra_args }}
run: |
# Prepare release artifact
tar -zcvf "release-enterprise-ai-${VERSION}.tar.gz" --transform 's,^,cluster-forge/,' root/ scripts/ sources
Expand Down
2 changes: 1 addition & 1 deletion root/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
clusterForge:
repoUrl: "http://gitea-http.cf-gitea.svc:3000/cluster-org/cluster-forge.git"
targetRevision: v1.8.0-rc2
targetRevision: null
# source helm values file from separate git repo
externalValues:
enabled: true
Expand Down
62 changes: 0 additions & 62 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,56 +100,6 @@ HELP_OUTPUT
esac
done

validate_target_revision() {
# Always allow main and the latest release
if [ "$TARGET_REVISION" = "main" ] || [ "$TARGET_REVISION" = "$LATEST_RELEASE" ]; then
return 0
fi

# Check if it's a valid v1.8.0+ semantic version pattern
if [[ "$TARGET_REVISION" =~ ^v1\.8\. ]] || [[ "$TARGET_REVISION" =~ ^v1\.([9-9]|[1-9][0-9]+)\. ]] || [[ "$TARGET_REVISION" =~ ^v[2-9]\. ]]; then
return 0
fi

# For branches/commits, check git ancestry to see if v1.8.0-rc1 or later is in the history
echo "Checking git ancestry for target revision: $TARGET_REVISION"

# Check if the target revision exists in git (try local first, then remote)
RESOLVED_REVISION=""
if git rev-parse --verify "$TARGET_REVISION" >/dev/null 2>&1; then
RESOLVED_REVISION="$TARGET_REVISION"
elif git rev-parse --verify "origin/$TARGET_REVISION" >/dev/null 2>&1; then
RESOLVED_REVISION="origin/$TARGET_REVISION"
echo "Found target revision as remote branch: origin/$TARGET_REVISION"
else
echo "ERROR: Target revision '$TARGET_REVISION' does not exist in git"
echo "Available branches: $(git branch -a | grep -v HEAD | sed 's/^[ *]*//' | tr '\n' ' ')"
exit 1
fi

# Check if v1.8.0-rc1 or any later version is an ancestor of the target revision
# We'll check for v1.8.0-rc1 as the minimum supported version
MIN_SUPPORTED_TAG="v1.8.0-rc1"

# Check if the minimum supported tag exists
if git rev-parse --verify "$MIN_SUPPORTED_TAG" >/dev/null 2>&1; then
# Check if MIN_SUPPORTED_TAG is an ancestor of RESOLVED_REVISION
if git merge-base --is-ancestor "$MIN_SUPPORTED_TAG" "$RESOLVED_REVISION" 2>/dev/null; then
echo "Target revision '$TARGET_REVISION' is based on or after $MIN_SUPPORTED_TAG - supported"
return 0
else
echo "ERROR: Target revision '$TARGET_REVISION' is not based on $MIN_SUPPORTED_TAG or later"
echo "The --target-revision flag only supports revisions based on $MIN_SUPPORTED_TAG and later versions"
echo "Supported: v1.8.0+, main, branches forked from v1.8.0-rc1+, or $LATEST_RELEASE"
exit 1
fi
else
echo "WARNING: Minimum supported tag '$MIN_SUPPORTED_TAG' not found in git"
echo "Proceeding with target revision '$TARGET_REVISION' (ancestry check skipped)"
return 0
fi
}

# Validate required arguments
if [ -z "$DOMAIN" ]; then
echo "ERROR: Domain argument is required"
Expand Down Expand Up @@ -242,9 +192,6 @@ pre_cleanup() {
}

display_target_revision

# Validate target revision and setup sources
validate_target_revision
setup_sources
setup_values_files

Expand All @@ -260,15 +207,6 @@ if [ -n "$SIZE_VALUES_FILE" ]; then
fi
echo "Target revision: $TARGET_REVISION"
echo ""
echo "⚠️ This will bootstrap ClusterForge on your cluster with the above configuration."
echo " Existing ArgoCD, OpenBao, and Gitea resources may be modified or replaced."
echo ""
read -p "Continue with bootstrap? [Y/n]: " -r
echo ""
if [[ $REPLY =~ ^[Nn]$ ]]; then
echo "Bootstrap cancelled by user."
exit 0
fi
echo "=== Starting Bootstrap Process ==="

# Check for yq command availability
Expand Down
4 changes: 1 addition & 3 deletions scripts/init-gitea-job/values.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# small|medium|large (injected by bootstrap script)
clusterSize: null

# Domain for the cluster (injected by bootstrap script)
# Example: "compute.amd.com"
domain: null

# Git revision to deploy (injected by bootstrap script)
targetRevision: null
targetRevision: null