Skip to content

Commit

Permalink
Merge pull request rancher#45206 from slickwarren/cwarren/v2.8/shephe…
Browse files Browse the repository at this point in the history
…rd-script-improvements

[v2.8] shepherd script improvements
  • Loading branch information
slickwarren authored Apr 24, 2024
2 parents 737d43e + ca7a112 commit 9410818
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/scripts/shepherd/update-gomod-shepherd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,24 @@ fi
echo "getting latest shepherd version for branch $2"
cd $1
git checkout $2 -q
git fetch -q
git fetch upstream -q
git pull -q
export SHEPHERD_VERSION=$(curl -s https://proxy.golang.org/github.com/rancher/shepherd/@v/$(git log -n 1 --pretty=format:"%H").info | grep -E -o "\bv0.0.0-+[A-Za-z0-9.-]+[A-Za-z0-9.-]\b")
git rebase upstream/$2

if [[ $4 == "" ]]; then
export upstream="rancher"
else
export upstream=$4
fi

export SHEPHERD_VERSION=$(curl -s https://proxy.golang.org/github.com/$upstream/shepherd/@v/$(git log -n 1 --pretty=format:"%H").info | grep -E -o "\bv0.0.0-+[A-Za-z0-9.-]+[A-Za-z0-9.-]\b")
echo "Shepherd Version is: $SHEPHERD_VERSION"

echo "writing version to go.mod, then tidying in $3"
cd $3

if [ $upstream == "rancher" ]; then
go get github.com/rancher/shepherd@$SHEPHERD_VERSION
if [[ $upstream == "rancher" ]]; then
go get github.com/$upstream/shepherd@$SHEPHERD_VERSION
else
go mod edit -replace=github.com/rancher/shepherd=github.com/$upstream/shepherd@$SHEPHERD_VERSION
fi
Expand Down

0 comments on commit 9410818

Please sign in to comment.