Created
October 9, 2019 14:54
-
-
Save AesSedai101/88652c40640cd64cc77551cdcee7adf0 to your computer and use it in GitHub Desktop.
Bitrise build results to csv
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
accessToken="<Bitrise token>" | |
file="bitrise_results.csv" | |
response=$(curl "https://api.bitrise.io/v0.1/builds?limit=50" -H "accept: application/json" -H "Authorization: $accessToken") | |
echo "Clearing out $file" | |
# These need to match the fields specified in the jq .data | map | |
echo "Triggered, Finished, Status, Slug, Workflow, Triggered by, Repo" > $file | |
for count in {1..20} # Will grab details on the most recent 20*50=1000 build results | |
do | |
echo "Loop: $count" | |
echo "$response" | jq '.data | map("\(.triggered_at), \(.finished_at), \(.status_text), \(.slug), \(.triggered_workflow), \(.triggered_by), \(.repository.title)") | .[]' | sed s/\"//g >> $file | |
next=$(echo "$response" | jq '.paging.next' | sed s/\"//g ) | |
echo "Curling $next" | |
response=$(curl "https://api.bitrise.io/v0.1/builds?limit=50&next=$next" -H "accept: application/json" -H "Authorization: $accessToken") | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment