From 7f40b2d0863dbe0a63f16f5a72373056d9c9aaf0 Mon Sep 17 00:00:00 2001 From: Michael Balsillie Date: Mon, 22 Aug 2022 12:50:16 +1200 Subject: [PATCH] add reason to fialure message --- .woodpecker.yml | 9 +++++---- check-tag.sh | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 36ea6dc..5c773b7 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -89,7 +89,7 @@ pipeline: commands: - sleep 60 - shoutrrr send - --url matrix://$${MATRIX_ACCESS_TOKEN}@$${MATRIX_HOST}:$${MATRIX_PORT}/?rooms=$${MATRIX_ROOM} + --url matrix://:$${MATRIX_ACCESS_TOKEN}@$${MATRIX_HOST}:$${MATRIX_PORT}/?rooms=$${MATRIX_ROOM} --message "New image build of $${ORGANIZATION}/$${REPO}, $${TAG}, has completed and been deployed." when: status: @@ -104,10 +104,11 @@ pipeline: - source: MATRIX_ACCESS_TOKEN target: MATRIX_ACCESS_TOKEN commands: - - sleep 60 + - REASON='Reason:' + - REASON=$REASON$(cat /git/pipeline/reason) - shoutrrr send - --url matrix://$${MATRIX_ACCESS_TOKEN}@$${MATRIX_HOST}:$${MATRIX_PORT}/?rooms=$${MATRIX_ROOM} - --message "New image build of $${ORGANIZATION}/$${REPO}, $${TAG}, has failed." + --url matrix://:$${MATRIX_ACCESS_TOKEN}@$${MATRIX_HOST}:$${MATRIX_PORT}/?rooms=$${MATRIX_ROOM} + --message "New image build of $${ORGANIZATION}/$${REPO}, $${TAG}, has failed. $${REASON}" when: status: - failure \ No newline at end of file diff --git a/check-tag.sh b/check-tag.sh index 1daecb4..9a994ad 100755 --- a/check-tag.sh +++ b/check-tag.sh @@ -1,11 +1,13 @@ #!/bin/bash if [[ $TAG =~ ^v1\...\..rc.$ ]]; then echo "Tag ${TAG} appears to be a release candidate, terminating build." + echo " Tag is an RC." > /git/pipeline/reason exit 1 elif [[ $TAG =~ ^v1\...\..$ ]]; then echo "Tag ${TAG} appears to be a release tag, proceeding." exit 0 else echo "Unable to determine nature of tag, terminating build." + echo " Cannot parse tag." > /git/pipeline/reason exit 1 fi \ No newline at end of file