add status report of instances

This commit is contained in:
pedro 2024-02-20 10:57:28 +01:00
parent d53b35fff4
commit 45f230550d
1 changed files with 34 additions and 0 deletions

34
status.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/sh
set -e
set -u
# DEBUG
#set -x
main() {
#instances="$(ls -1 build__* \
# | grep -E 'instance|pilot' \
# | cut -d'_'
# )"
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}
commit="$(git log --pretty=format:'%H' -n 1)"
cd - >/dev/null
d_name="$(basename "${d}")"
echo " - ${d_name}, commit: ${commit}"
done
done
}
main "${@}"