Skip to content

Commit

Permalink
create-release-branches.bash: refactor
Browse files Browse the repository at this point in the history
- extract listK3sRepoBranches
- fix error

 line 10: [: ==: unary operator expected
  • Loading branch information
gberche-orange committed Jan 3, 2024
1 parent 2428c53 commit 4712500
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions create-release-branches.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ set -e # exit on non-zero status
# When PUSH_OPTIONS=true, it also recreates all existing release branches from master branch

PUSH_OPTIONS=""
if [ $FORCE_PUSH = "true" ] ;then
if [ "$FORCE_PUSH" == "true" ] ;then
PUSH_OPTIONS="$PUSH_OPTIONS --force"
fi
current_version=$(yq -r '.directories[0].contents[] | select (.path=="k3s-io/k3s") | .githubRelease.tag ' ./vendir.yml)
current_version=${current_version#v}
MIN_VERSION=$(echo "$current_version"|cut -d'.' -f1-2)
for ref in $(git ls-remote -h https://github.com/k3s-io/k3s "release-*" | sed 's/refs\/heads\///' | awk '{print $2}') ; do

function listK3sRepoBranches() {
git ls-remote -h https://github.com/k3s-io/k3s "release-*" | sed 's/refs\/heads\///' | awk '{print $2}'
}

for ref in $(listK3sRepoBranches) ; do
v=${ref#release-}
BRANCH_NAME="${ref}"
echo "Extracted values - v: $v - BRANCH_NAME: $BRANCH_NAME"
Expand Down

0 comments on commit 4712500

Please sign in to comment.