Skip to content

Release branch script #510

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

Closed
fhennig opened this issue Dec 14, 2023 · 3 comments · Fixed by #511
Closed

Release branch script #510

fhennig opened this issue Dec 14, 2023 · 3 comments · Fixed by #511

Comments

@fhennig
Copy link
Contributor

fhennig commented Dec 14, 2023

There is a version_bump.sh script, but it is outdated. Create a script that gets given a release (with full major.minor.patch) and then

  • check if on main branch, working directory empty and up-to-date
  • checkout new branch "release/major.minor"
  • update antora.yaml file:
    • set the 'version' key
    • set the 'prerelease' key to false
    • set the 'crd-docs-version' key
  • show a diff and ask for confirmation
  • commit changes
  • push the branch

This does the checks (probably):

#!/bin/bash

# Check if on main branch
current_branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$current_branch" != "main" ]; then
    echo "Not on the main branch. Please switch to the main branch."
    exit 1
fi

# Check if the branch is up to date with the origin
git fetch
if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/main)" ]; then
    echo "Your branch is not up to date with the origin main branch. Please pull the latest changes."
    exit 1
fi

# Check if the working directory is clean
if [ -n "$(git status --porcelain)" ]; then
    echo "Working directory is not clean. Please commit or stash your changes."
    exit 1
fi

echo "All checks passed. You are on the main branch, up to date with the origin, and the working directory is clean."

@adwk67
Copy link
Member

adwk67 commented Dec 14, 2023

Should this script reside in stackable-utils? If not we should at least mention it in the README there so that we have release-related info in one place.

@fhennig
Copy link
Contributor Author

fhennig commented Dec 14, 2023

Ah yeah so I was thinking about keeping the script in the docs repo, but definitely link it from stackable-utils. But since the procedures in it are specific to the docs repo I thought it makes sense to maintain it in here. What do you think?

@adwk67
Copy link
Member

adwk67 commented Dec 14, 2023

Yes, that makes sense. As long as we link it so that it is clear that it is part of the release process steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants