This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
idhub-docker/status.sh

44 lines
1.2 KiB
Bash
Raw Normal View History

2024-02-20 09:57:28 +00:00
#!/bin/sh
set -e
set -u
# DEBUG
#set -x
2024-02-29 16:07:27 +00:00
_git_info() {
d="${1}"
cd ${d}
# src https://ma.ttias.be/pretty-git-log-in-one-line/
commit_info="$(git log --pretty=format:'[%ci] %h %an: %s' -n 1)"
cd - >/dev/null
d_name="$(basename "${d}")"
}
2024-02-20 09:57:28 +00:00
main() {
2024-02-20 09:59:56 +00:00
cd "$(dirname "${0}")"
2024-02-20 09:57:28 +00:00
instances="$(find . -maxdepth 1 -type d \
| grep -E 'pilot|instance' \
2024-02-29 16:18:06 +00:00
| cut -d'_' -f3 \
| sort -u
2024-02-20 09:57:28 +00:00
)"
2024-02-29 16:07:27 +00:00
_git_info ./ssikit_trustchain
printf -- "%-31s | commit: %s\n" "${d_name}" "${commit_info}"
printf -- " note: outdated ssikit_trustchain version could be present on any instance. Hence, this only relevant for new or fresh builds\n\n"
2024-02-20 09:57:28 +00:00
for i in ${instances}; do
dirs="$(find . -maxdepth 1 -type d \
| grep -E 'pilot|instance' \
| grep "${i}"
)"
echo "- ${i}"
for d in ${dirs}; do
2024-02-29 16:07:27 +00:00
_git_info "${d}"
printf -- " - %-25s | commit: %s\n" "${d_name}" "${commit_info}"
2024-02-20 09:57:28 +00:00
done
done
}
main "${@}"