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
2024-02-29 12:59:27 +01:00

33 lines
966 B
Bash
Executable file

#!/bin/sh
set -e
set -u
# DEBUG
#set -x
main() {
cd "$(dirname "${0}")"
instances="$(find . -maxdepth 1 -type d \
| grep -E 'pilot|instance' \
| cut -d'_' -f3
)"
for i in ${instances}; do
dirs="$(find . -maxdepth 1 -type d \
| grep -E 'pilot|instance' \
| grep "${i}"
)"
echo "- ${i}"
for d in ${dirs}; do
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}")"
printf " - %-25s | commit: %s\n" "${d_name}" "${commit_info}"
done
done
}
main "${@}"