From 45f230550ddc7fbb87bcc03c9bfed0537ba17500 Mon Sep 17 00:00:00 2001 From: pedro Date: Tue, 20 Feb 2024 10:57:28 +0100 Subject: [PATCH] add status report of instances --- status.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 status.sh diff --git a/status.sh b/status.sh new file mode 100755 index 0000000..a82bfd3 --- /dev/null +++ b/status.sh @@ -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 "${@}"