Created
October 3, 2016 21:16
-
-
Save mislav/e7dbb6f01abae753b07d50f734baa362 to your computer and use it in GitHub Desktop.
Publish a git branch and open a tmux split that reports the outcome of CI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Pushes the current branch to origin and opens a tiny tmux split to track | |
# the CI status. Upon completion, speaks the status aloud using `say`. | |
set -e | |
if [ "$1" != "--wait" ]; then | |
git push -u origin HEAD | |
tmux split-window -dv -l 2 "'$0' --wait" | |
else | |
ref="$(git rev-parse -q HEAD)" | |
branch="$(git symbolic-ref --short -q HEAD)" | |
while sleep 10; do | |
STATUS=0 | |
output="$(hub ci-status "$ref" 2>&1)" || STATUS="$?" | |
if [ "$STATUS" -eq 2 ]; then | |
printf '*' | |
elif [ "$STATUS" -eq 3 ]; then | |
printf '.' | |
else | |
echo " $output" | |
say -v fred "$branch is $output" | |
exit "$STATUS" | |
fi | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment