From 752d61ea4fe03ecd766ea284fc41d5d12af3f1cf Mon Sep 17 00:00:00 2001 From: Michael Balsillie Date: Mon, 22 Aug 2022 12:42:28 +1200 Subject: [PATCH] condiitional notifications --- .woodpecker.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index c3c4d66..36ea6dc 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -78,7 +78,7 @@ pipeline: - HEADER=$HEADER" Bearer $WATCHTOWER_HTTP_API_TOKEN" - curl -H $HEADER -i "https://$${WATCHTOWER_HOST}/v1/update" - notify-matrix: + notify-matrix-success: image: code.balsillie.net/containers/woodpecker-util pull: false environment: @@ -90,4 +90,24 @@ pipeline: - sleep 60 - shoutrrr send --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." \ No newline at end of file + --message "New image build of $${ORGANIZATION}/$${REPO}, $${TAG}, has completed and been deployed." + when: + status: + - success + + notify-matrix-failure: + image: code.balsillie.net/containers/woodpecker-util + pull: false + environment: + *vars + secrets: + - source: MATRIX_ACCESS_TOKEN + target: MATRIX_ACCESS_TOKEN + commands: + - sleep 60 + - shoutrrr send + --url matrix://$${MATRIX_ACCESS_TOKEN}@$${MATRIX_HOST}:$${MATRIX_PORT}/?rooms=$${MATRIX_ROOM} + --message "New image build of $${ORGANIZATION}/$${REPO}, $${TAG}, has failed." + when: + status: + - failure \ No newline at end of file