From eba2daba13ed4cb5f151588c25ccbdd69fcd4f74 Mon Sep 17 00:00:00 2001 From: surtur Date: Fri, 25 Sep 2020 19:15:08 +0200 Subject: [PATCH 1/3] refactor: remove redundant status==success assertion --- .drone.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index bfcd03a..a500552 100644 --- a/.drone.yml +++ b/.drone.yml @@ -33,9 +33,6 @@ steps: - name: hugo-extended pull: if-not-exists image: immawanderer/fedora-hugo:latest - when: - status: - - success commands: - git submodule init - git submodule update -- 2.47.0 From 9fc744822a4bf862b6674e95c4c253c463875844 Mon Sep 17 00:00:00 2001 From: surtur Date: Fri, 25 Sep 2020 19:34:38 +0200 Subject: [PATCH 2/3] chore: separate build and deploy pipeline * this allows for more granular run conditions and constraints --- .drone.yml | 48 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index a500552..c96f853 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,11 +24,49 @@ steps: --- kind: pipeline type: docker -name: 'build and deploy' +name: build + +platform: + os: linux + arch: amd64 depends_on: - pull +steps: +- name: hugo-extended + pull: if-not-exists + image: immawanderer/fedora-hugo:latest + when: + event: + exclude: + - cron + - tag + commands: + - git submodule init + - git submodule update + - hugo version + - hugo --gc=true --minify + + +--- +kind: pipeline +type: docker +name: deploy + +platform: + os: linux + arch: amd64 + +trigger: + event: + exclude: + - pull_request + - tag + +depends_on: +- build + steps: - name: hugo-extended pull: if-not-exists @@ -47,10 +85,6 @@ steps: - success branch: - master - event: - - push - - tag - - cron depends_on: - hugo-extended environment: @@ -89,7 +123,7 @@ trigger: - failure depends_on: -- 'build and deploy' +- deploy steps: - name: discord @@ -135,7 +169,7 @@ trigger: - failure depends_on: -- 'build and deploy' +- deploy steps: - name: discord -- 2.47.0 From 89fdc553ef26d57fd878bc512eb29362efc72f78 Mon Sep 17 00:00:00 2001 From: surtur Date: Fri, 25 Sep 2020 19:43:40 +0200 Subject: [PATCH 3/3] refactor: positive rather than negative selection * i.e. includes as opposed to excludes --- .drone.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index c96f853..40f55e2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -38,10 +38,11 @@ steps: pull: if-not-exists image: immawanderer/fedora-hugo:latest when: + branch: + - master event: - exclude: - - cron - - tag + - push + - pull_request commands: - git submodule init - git submodule update -- 2.47.0