Skip to content

Commit

Permalink
Fix init.sh to work with a tag (#160)
Browse files Browse the repository at this point in the history
* Fix init.sh to work with a tag

* Need to run git as NEPHIO_USER

* Fix call to runuser
  • Loading branch information
johnbelamaric authored Jul 7, 2023
1 parent 3eee737 commit 49042bf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion e2e/provision/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ if [ ! -d "$REPO_DIR" ]; then
runuser -u "$NEPHIO_USER" git clone "$REPO" "$REPO_DIR"
if [[ $BRANCH != "main" ]]; then
pushd "$REPO_DIR" >/dev/null
runuser -u "$NEPHIO_USER" -- git checkout -b "$BRANCH" --track "origin/$BRANCH"
TAG=$(runuser -u "$NEPHIO_USER" -- git tag --list $BRANCH)
if [[ $TAG == $BRANCH ]]; then
runuser -u "$NEPHIO_USER" -- git checkout --detach "$TAG"
else
runuser -u "$NEPHIO_USER" -- git checkout -b "$BRANCH" --track "origin/$BRANCH"
fi
popd >/dev/null
fi
fi
Expand Down

0 comments on commit 49042bf

Please sign in to comment.