From c6d88ce832e27a175ff7768baba4b6eb01d7d70a Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Mon, 16 May 2022 09:04:46 +0200 Subject: [PATCH] nightly attempt 2 Signed-off-by: Christian Richter --- .drone.star | 70 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 63 insertions(+), 7 deletions(-) diff --git a/.drone.star b/.drone.star index 099df12..526a11c 100644 --- a/.drone.star +++ b/.drone.star @@ -2,13 +2,17 @@ def main(ctx): return [ stepPR("amd64", "motsognir"), stepPR("arm64", "motsognir"), - stepMergeMasterAndBuildWeekly("amd64", "motsognir"), - stepMergeMasterAndBuildWeekly("arm64", "motsognir"), + stepMergeMaster("amd64", "motsognir"), + stepMergeMaster("arm64", "motsognir"), + stepBuildWeekly("amd64", "motsognir"), + stepBuildWeekly("arm64", "motsognir"), stepPR("amd64", "webtest"), stepPR("arm64", "webtest"), - stepMergeMasterAndBuildWeekly("amd64", "webtest"), - stepMergeMasterAndBuildWeekly("arm64", "webtest"), + stepMergeMaster("amd64", "webtest"), + stepMergeMaster("arm64", "webtest"), + stepBuildWeekly("amd64", "webtest"), + stepBuildWeekly("arm64", "webtest"), ] @@ -62,7 +66,7 @@ def stepPR(arch, path): }, } -def stepMergeMasterAndBuildWeekly(arch, path): +def stepMergeMaster(arch, path): return { "kind": "pipeline", "type": "docker", @@ -114,12 +118,64 @@ def stepMergeMasterAndBuildWeekly(arch, path): "status": [ "success", "failure" + ] + } + } + +def stepBuildWeekly(arch, path): + return { + "kind": "pipeline", + "type": "docker", + "name": "docker-publish-weekly-%s-%s" % (path, arch), + "platform": { + "os": "linux", + "arch": arch, + }, + "steps": [ + { + "name": "build-and-publish-image-%s-%s" % (path, arch), + "image": "plugins/docker", + "settings": { + "dockerfile": "%s/Dockerfile" % (path), + "repo": "dragonchaser/%s" % (path), + "dry_run": "false", + "tag": "latest-%s" % (arch), + "username": { + "from_secret": "dockerhub-user" + }, + "password": { + "from_secret": "dockerhub-password" + } + } + }, + { + "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" + } + } + }, + ], + "trigger": { + "ref": [ + "refs/heads/master", ], "event": [ "cron" ], "cron": [ - "nightly" + "weekly" ] }, - } + } \ No newline at end of file