Last active
March 1, 2024 16:35
-
-
Save kk7ds/9a77939bd314cd4b5a35139adcdcedce to your computer and use it in GitHub Desktop.
Tool to fetch, convert and display openstack gate job journals
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
#!/bin/bash | |
# Usage: call with a base url to a gate job log, like: | |
# https://zuul.opendev.org/t/openstack/build/83d6dc665c2643f88d0025c385987c92 | |
# | |
# Any other arguments go to the journalctl | |
URL="$1" | |
shift | |
uuid=$(echo $URL | cut -d / -f 7) | |
tmpf="/tmp/openstack-${uuid}.journal" | |
if [ ! -f "$tmpf" ]; then | |
logs=$(curl -s https://zuul.opendev.org/api/tenant/openstack/builds?uuid=${uuid} | jq -r '.[0].log_url') | |
journal_url="${logs}controller/logs/devstack.journal.gz" | |
curl -s "$journal_url" | zcat | /usr/lib/systemd/systemd-journal-remote - -o "$tmpf" | |
fi | |
journalctl --file "$tmpf" $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment