Created
April 13, 2018 22:59
-
-
Save GauntletWizard/6df00c4e22995230355e5be84747d82a to your computer and use it in GitHub Desktop.
Saves honeycomb boards for version control purposes
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 | |
# honeysave.sh - Saves honeycomb boards for version control purposes | |
WRITEKEY="" | |
honeycurl() { | |
curl -H "X-Honeycomb-Team: ${WRITEKEY}" https://api.honeycomb.io/1/boards/$* | |
} | |
save() { | |
BOARDS=$(honeycurl | jq -r '.[].id') | |
for BOARD in ${BOARDS} | |
do | |
TMPFILE="$(mktemp)" | |
honeycurl $BOARD > "$TMPFILE" | |
echo "$TMPFILE" | |
BOARDNAME="$(jq -r .name "$TMPFILE")" | |
mv "$TMPFILE" "boards/${BOARDNAME}.json" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment