Created
October 6, 2017 03:02
-
-
Save nysalor/9d41b2ec2119bc5443586d25cf772b38 to your computer and use it in GitHub Desktop.
CircleCI rebuild function (with peco and jq)
This file contains hidden or 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
# set CircleCI token to $CIRCLECI_TOKEN | |
function ci-rebuild () { | |
BUILDID=$(curl -s "https://circleci.com/api/v1/recent-builds?circle-token=$CIRCLECI_TOKEN" |jq -r '.[] | "\(.username)/\(.reponame)/\(.build_num) \(.subject)"' | peco | cut -f 1 -d ' ') | |
if test "${BUILDID}" != ""; then | |
curl -X POST "https://circleci.com/api/v1/project/$BUILDID/retry?circle-token=$CIRCLECI_TOKEN" | |
fi | |
} | |
zle -N ci-rebuild |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment