From d488f9c10fb7addae0f69e96c6ef1655176e5617 Mon Sep 17 00:00:00 2001 From: Varakh Date: Fri, 24 Mar 2023 08:36:59 +0100 Subject: [PATCH] Make pipeline more useful --- .drone.yml | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 04f97dd..295dcb2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,8 +4,6 @@ type: docker name: build and publish trigger: - branch: - - master event: include: - push @@ -18,23 +16,23 @@ steps: CREATED: ${DRONE_BUILD_CREATED} SOURCE_URL: ${DRONE_GIT_HTTP_URL} settings: + dry_run: true purge: true - username: - from_secret: dockerhub_user - password: - from_secret: dockerhub_key repo: varakh/hetzner-storagebox-exporter tags: - - latest + - ${DRONE_COMMIT_SHA} --- kind: pipeline type: docker -name: monthly build and publish +name: build and publish trigger: event: - cron + - promote + target: + - production cron: include: - monthly @@ -54,4 +52,30 @@ steps: from_secret: dockerhub_key repo: varakh/hetzner-storagebox-exporter tags: - - monthly + - latest + when: + branch: + - master + +--- +kind: pipeline +type: docker +name: result + +steps: + - name: notify + image: drillster/drone-email + settings: + subject: "Build failed" + body: "URL ${DRONE_BUILD_LINK}" + host: + from_secret: mail_host + username: + from_secret: mail_user + password: + from_secret: mail_password + from: + from_secret: mail_from + when: + status: + - failure