From 6daf086844a445b2ad7b7dfa8bc287f224e4d8c1 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Thu, 19 May 2022 11:35:42 +0200 Subject: [PATCH] test seperate notify pipeline Signed-off-by: Christian Richter --- .drone.star | 133 +++++++++++++++++++++++++--------------------------- 1 file changed, 63 insertions(+), 70 deletions(-) diff --git a/.drone.star b/.drone.star index 526a11c..c2e7e7c 100644 --- a/.drone.star +++ b/.drone.star @@ -1,22 +1,66 @@ def main(ctx): return [ - stepPR("amd64", "motsognir"), - stepPR("arm64", "motsognir"), - stepMergeMaster("amd64", "motsognir"), - stepMergeMaster("arm64", "motsognir"), - stepBuildWeekly("amd64", "motsognir"), - stepBuildWeekly("arm64", "motsognir"), - - stepPR("amd64", "webtest"), - stepPR("arm64", "webtest"), - stepMergeMaster("amd64", "webtest"), - stepMergeMaster("arm64", "webtest"), - stepBuildWeekly("amd64", "webtest"), - stepBuildWeekly("arm64", "webtest"), + stepPR(ctx, "amd64", "motsognir"), + stepPR(ctx, "arm64", "motsognir"), + stepMergeMaster(ctx, "amd64", "motsognir"), + stepMergeMaster(ctx, "arm64", "motsognir"), + stepBuildWeekly(ctx, "amd64", "motsognir"), + stepBuildWeekly(ctx, "arm64", "motsognir"), + + stepPR(ctx, "amd64", "webtest"), + stepPR(ctx, "arm64", "webtest"), + stepMergeMaster(ctx, "amd64", "webtest"), + stepMergeMaster(ctx, "arm64", "webtest"), + stepBuildWeekly(ctx, "amd64", "webtest"), + stepBuildWeekly(ctx, "arm64", "webtest"), + + notify(ctx), ] +def notify(ctx): + return { + "kind": "pipeline", + "type": "docker", + "name": "matrix-notifications", + "clone": { + "disable": True, + }, + "steps": [ + { + "name": "notify", + "image": "plugins/matrix", + "settings": { + "homeserver": { + "from_secret": "matrix-homeserver" + }, + "roomid": { + "from_secret": "matrix-room" + }, + "username": { + "from_secret": "matrix-user" + }, + "password": { + "from_secret": "matrix-password" + } + } + }, + ], + "depends_on": [], + "trigger": { + "ref": [ + "refs/heads/master", + "refs/heads/release*", + "refs/tags/**", + ], + "status": [ + "failure", + "success", + "failure", + ], + }, + } -def stepPR(arch, path): +def stepPR(ctx, arch, path): return { "kind": "pipeline", "type": "docker", @@ -36,25 +80,8 @@ def stepPR(arch, path): "tag": "latest-%s" % (arch), } }, - { - "name": "notify-build-%s-%s" % (path, arch), - "image": "plugins/matrix", - "settings": { - "homeserver": { - "from_secret": "matrix-homeserver" - }, - "roomid": { - "from_secret": "matrix-room" - }, - "username": { - "from_secret": "matrix-user" - }, - "password": { - "from_secret": "matrix-password" - } - } - }, ], + "depends_on": ["matrix-notifications"], "trigger": { "ref": [ "refs/pull/**", @@ -66,7 +93,7 @@ def stepPR(arch, path): }, } -def stepMergeMaster(arch, path): +def stepMergeMaster(ctx, arch, path): return { "kind": "pipeline", "type": "docker", @@ -92,25 +119,8 @@ def stepMergeMaster(arch, path): } } }, - { - "name": "notify-publish-%s-%s" % (path, arch), - "image": "plugins/matrix", - "settings": { - "homeserver": { - "from_secret": "matrix-homeserver" - }, - "roomid": { - "from_secret": "matrix-room" - }, - "username": { - "from_secret": "matrix-user" - }, - "password": { - "from_secret": "matrix-password" - } - } - }, ], + "depends_on": [], "trigger": { "ref": [ "refs/heads/master", @@ -122,7 +132,7 @@ def stepMergeMaster(arch, path): } } -def stepBuildWeekly(arch, path): +def stepBuildWeekly(ctx, arch, path): return { "kind": "pipeline", "type": "docker", @@ -148,25 +158,8 @@ def stepBuildWeekly(arch, path): } } }, - { - "name": "notify-publish-%s-%s" % (path, arch), - "image": "plugins/matrix", - "settings": { - "homeserver": { - "from_secret": "matrix-homeserver" - }, - "roomid": { - "from_secret": "matrix-room" - }, - "username": { - "from_secret": "matrix-user" - }, - "password": { - "from_secret": "matrix-password" - } - } - }, ], + "depends_on": [], "trigger": { "ref": [ "refs/heads/master",