From a015e218a6642e36ea4480c8c1c70e3556706a3d Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Sun, 28 Aug 2022 09:17:55 -0600 Subject: [PATCH] deploy: show commit message for deployed revisions --- common.sh | 2 +- deploy | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common.sh b/common.sh index 5d25619..349a88e 100644 --- a/common.sh +++ b/common.sh @@ -5,7 +5,7 @@ AgentKeys="$(ssh-add -L | awk '{print $2}')" RunHost="$(uname -n)" msg() { - echo "===> $@" + echo -e "===> $@" } resolveAlias() { diff --git a/deploy b/deploy index 856165d..7753f07 100755 --- a/deploy +++ b/deploy @@ -31,7 +31,8 @@ rebuild() { if [ "$1" = "status" ]; then start - msg "Currently at: $(git rev-parse HEAD)" + rev=$(git rev-parse HEAD) + msg "Currently at: ${rev}\t($(git log --format=%B -n 1 $rev | head -n1))" for h in $(ls hosts); do host="$(resolveAlias $h)" if ! tsAlive $host; then @@ -40,7 +41,9 @@ if [ "$1" = "status" ]; then fi echo -n "===> $h: " host_data="$(${SSH} root@${host} 'nixos-version --json')" - echo -e "\t\t$(echo $host_data | jq -r .nixosVersion)\t$(echo $host_data | jq -r .configurationRevision)" + remote_rev=$(echo $host_data | jq -r .configurationRevision) + remote_ver=$(echo $host_data | jq -r .nixosVersion) + echo -e "\t\t${remote_ver}\t${remote_rev}\t($(git log --format=%B -n 1 $remote_rev | head -n1))" done finish exit 0