Skip to content

Commit

Permalink
capture ERROR - RET=$?
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMikulec committed Aug 3, 2024
1 parent 8bdf952 commit afb8f5a
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,45 @@ jobs:
sudo /etc/init.d/postgresql stop
sudo apt-get remove --purge postgresql\*
sudo rm -rf /etc/postgresql /var/lib/postgresql
git ls-remote --tags https://github.com/postgres/postgres.git | cut -c 52- | grep -e 'REL_17_[0-9]'
export GITTAG=REL_17_BETA2
git ls-remote --tags https://github.com/postgres/postgres.git | cut -c 52- | grep -e 'REL_17_[0-9]' ; RET=$?
case "$RET" in
"0")
echo -n "Release(s) are found. Taking the last Release . . . "
export GITTAG=$(git ls-remote --tags https://github.com/postgres/postgres.git | cut -c 52- | grep -e 'REL_17_[0-9]' | tail -n 1)
;;
"1")
echo "Release(s) are not found. Trying Release Candidates."
git ls-remote --tags https://github.com/postgres/postgres.git | cut -c 52- | grep -e 'REL_17_RC[0-9]' ; RET=$?
case "$RET" in
"0")
echo -n "Release Candidate(s) are found. Taking the last Release Candidate . . . "
export GITTAG=$(git ls-remote --tags https://github.com/postgres/postgres.git | cut -c 52- | grep -e 'REL_17_RC[0-9]' | tail -n 1)
;;
"1")
echo "Release Candidate(s) are not found. Trying Betas."
git ls-remote --tags https://github.com/postgres/postgres.git | cut -c 52- | grep -e 'REL_17_BETA[0-9]' ; RET=$?
case "$RET" in
"0")
echo -n "Beta(s) are found. Taking the last Beta . . . "
export GITTAG=$(git ls-remote --tags https://github.com/postgres/postgres.git | cut -c 52- | grep -e 'REL_17_BETA[0-9]' | tail -n 1)
;;
"1")
echo "Beta(s) are not found."
;;
*)
echo "Beta Search unknown grep error."
;;
esac
;;
*)
echo "Release Candidate Search unknown grep error."
;;
esac
;;
*)
echo "Release Search unknown grep error."
;;
esac
echo $GITTAG
git clone --branch $GITTAG --depth=1 https://github.com/postgres/postgres.git
pushd postgres
Expand Down

0 comments on commit afb8f5a

Please sign in to comment.