From 7f6f9e8e67a545ebd10e5a6221d281b4df6869d0 Mon Sep 17 00:00:00 2001 From: Michael Balsillie Date: Mon, 22 Aug 2022 02:36:50 +1200 Subject: [PATCH] Add matrix notify step --- .woodpecker.yml | 28 +++++++++++++------ notify-watchtower.sh => trigger-watchtower.sh | 0 2 files changed, 19 insertions(+), 9 deletions(-) rename notify-watchtower.sh => trigger-watchtower.sh (100%) diff --git a/.woodpecker.yml b/.woodpecker.yml index 65b5f15..e1097e1 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -9,6 +9,9 @@ variables: - DOCKERFILE=docker/Dockerfile - CONTEXT=. - WATCHTOWER_HOST=watchtower.balsillie.net + - MATRIX_HOST=matrix.balsillie.net + - MATRIX_PORT=443 + - MATRIX_ROOM=!HdSXmuHcBMaYExEfkh:balsillie.net workspace: base: /git @@ -45,13 +48,7 @@ pipeline: volumes: - /var/run/docker.sock:/var/run/docker.sock environment: - - REGISTRY=code.balsillie.net - - REGISTRY_USER=michael - - ORGANIZATION=containers - - REPO=matrix-service-synapse - - BUILD_ARGS=PYTHON_VERSION=3.10 - - DOCKERFILE=docker/Dockerfile - - CONTEXT=. + *vars commands: - export DOCKER_BUILDKIT=1 - cd /git/$${REPO} @@ -68,7 +65,7 @@ pipeline: $${CONTEXT} - docker push -a $REGISTRY/$ORGANIZATION/$REPO - notify-watchtower: + trigger-watchtower: image: curlimages/curl pull: false environment: @@ -77,4 +74,17 @@ pipeline: - source: WATCHTOWER_HTTP_API_TOKEN target: WATCHTOWER_HTTP_API_TOKEN commands: - - /bin/sh /git/pipeline/notify-watchtower.sh \ No newline at end of file + - /bin/sh /git/pipeline/trigger-watchtower.sh + + notify-matrix: + image: containrrr/shoutrrr + pull: false + environment: + *vars + secrets: + - source: MATRIX_ACCESS_TOKEN + target: MATRIX_ACCESS_TOKEN + commands: + - shoutrrr send + --url matrix://$${MATRIX_ACCESS_TOKEN}@$${MATRIX_HOST}:$${MATRIX_PORT}/?rooms=$${MATRIX_ROOM} + --message "New image build $${ORGANIZATION}/$${REPO} has completed and been deployed." \ No newline at end of file diff --git a/notify-watchtower.sh b/trigger-watchtower.sh similarity index 100% rename from notify-watchtower.sh rename to trigger-watchtower.sh