From 01ad5eeb611bfcf4fda3dfa138fb6d7d512b136c Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Thu, 14 Mar 2019 13:54:36 +0100 Subject: [PATCH] fix notifications --- .drone.jsonnet | 18 +++++++++--------- .drone.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 769faff..d1056d1 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -37,7 +37,7 @@ local PipelineBuild(os='linux', arch='amd64') = { ], }; -local PipelineNotifications = { +local PipelineNotifications(depends_on=[]) = { kind: "pipeline", name: "notifications", platform: { @@ -54,17 +54,17 @@ local PipelineNotifications = { username: { "from_secret": "matrix_username" }, password: { "from_secret": "matrix_password" }, }, + when: { + status: [ "success", "failure" ], + }, }, ], - depends_on: [ - "deployment", - ], - trigger: { - event: [ "push", "tag" ], - status: [ "success", "failure" ], - }, + depends_on: depends_on, }; [ - PipelineBuild(os='linux', arch='amd64') + PipelineBuild(os='linux', arch='amd64'), + PipelineNotifications(depends_on=[ + 'linux-adm64', + ]) ] diff --git a/.drone.yml b/.drone.yml index 4fb39a2..2bad279 100644 --- a/.drone.yml +++ b/.drone.yml @@ -33,4 +33,30 @@ steps: username: from_secret: docker_username +--- +kind: pipeline +name: notifications + +platform: + os: linux + arch: amd64 + +steps: +- image: plugins/matrix + settings: + homeserver: https://matrix.rknet.org + password: + from_secret: matrix_password + roomid: MtidqQXWWAtQcByBhH:rknet.org + template: "Status: **{{ build.status }}**
Build: [{{ repo.Owner }}/{{ repo.Name }}]({{ build.link }}) ({{ build.branch }}) by {{ build.author }}
Message: {{ build.message }}" + username: + from_secret: matrix_username + when: + status: + - success + - failure + +depends_on: +- linux-adm64 + ...