Skip to content

Commit

Permalink
Add Git Commands to justfile
Browse files Browse the repository at this point in the history
Handles:
- old local branches
- creation of chore branches for each or individual versions
  • Loading branch information
o-otte committed Nov 18, 2024
1 parent 8981d00 commit f78d41f
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,34 @@ build-assets-all-local: build-versions-all
just build-assets-local-for ${version}
done
# Remove old branches that had been merged to main
[group('git')]
git-clean:
git branch --merged | grep -Ev "(^\*|^\+|master|main|dev)" | xargs --no-run-if-empty git branch -d

# Create Chore branch for specific Kubernetes Version
[group('git')]
git-chore-branch VERSION:
#!/usr/bin/env bash
currentBranch=$(git branch --show-current)
git switch -c chore/update-{{replace(VERSION, "-", ".") }}
cp -r providers/openstack/out/{{replace(VERSION, ".", "-") }}/* providers/openstack/scs/
git add providers/openstack/scs/
git commit -s -S -m "chore(versions): Update Release for {{replace(VERSION, "-", ".") }}"
#git push
git switch ${currentBranch}
# Create chore branches for all available out versions
[group('git')]
git-chore-branches-all:
#!/usr/bin/env bash
if ! [[ -e providers/openstack/out ]]; then
echo "Error: out directory does not exists."
else
pushd providers/openstack/out
versions=$(echo *)
popd
for version in ${versions[@]}; do
just git-chore-branch $version
done
fi

0 comments on commit f78d41f

Please sign in to comment.