Skip to content

Instantly share code, notes, and snippets.

@cakuki
Created March 3, 2016 12:21
Show Gist options
  • Save cakuki/f7f2ce51a120fa706d88 to your computer and use it in GitHub Desktop.
Save cakuki/f7f2ce51a120fa706d88 to your computer and use it in GitHub Desktop.
Waiting for branch CI status success
#!/usr/bin/env bash
function waitci {
branch=${1:-"$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')"}
echo -n "Checking $branch branch..."
while :;
do cistatus=$(git ci-status $branch)
if [ "$cistatus" = "success" ]
then
echo "\nSuccess in $(date "+%Y-%m-%d %H:%M:%S")"
break
else
echo -n "."
fi
sleep 10
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment