From 9a71ae61013926528b22728ecf71bee160b54cfc Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 20 Jul 2018 11:55:41 +0200 Subject: [PATCH 1/9] Add drone config --- .drone.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..c77cec5 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,9 @@ +pipeline: + branches: develop + hugo: + image: cbrgm/drone-hugo:latest + buildDrafts: true + buildFuture: true + buildExpired: true + validate: true + url: https://staging.vbrandl.net From 6bd13e58d94d0e7fe4dc361e8ed12d07e9f61657 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 20 Jul 2018 11:57:28 +0200 Subject: [PATCH 2/9] Only build on develop branch --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index c77cec5..11485bf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,5 +1,4 @@ pipeline: - branches: develop hugo: image: cbrgm/drone-hugo:latest buildDrafts: true @@ -7,3 +6,4 @@ pipeline: buildExpired: true validate: true url: https://staging.vbrandl.net +branches: develop From 3c4d07a39cbc355e1cfd48c55a04913f3b9eee98 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 20 Jul 2018 12:11:13 +0200 Subject: [PATCH 3/9] Add rsync step to deploy blog --- .drone.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 11485bf..a6a9eaf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,9 +1,16 @@ pipeline: - hugo: + build: image: cbrgm/drone-hugo:latest buildDrafts: true buildFuture: true buildExpired: true validate: true url: https://staging.vbrandl.net + deploy: + image: drillster/drone-rsync + hosts: [ "vbrandl.net" ] + target: /var/www/staging.vbrandl.net + source: public/drone-generated/* + user: hugo + secrets: [ rsync_key ] branches: develop From a03f5edde5346995ff6c09482ea565930190ef5f Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 20 Jul 2018 12:30:01 +0200 Subject: [PATCH 4/9] Fix path --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index a6a9eaf..49f5e4b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,7 +10,7 @@ pipeline: image: drillster/drone-rsync hosts: [ "vbrandl.net" ] target: /var/www/staging.vbrandl.net - source: public/drone-generated/* + source: public/* user: hugo secrets: [ rsync_key ] branches: develop From 21f5e94ed59d44d0d9acdfae7242380d715522b2 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 20 Jul 2018 12:57:55 +0200 Subject: [PATCH 5/9] Add compress stepp --- .drone.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.drone.yml b/.drone.yml index 49f5e4b..e1860ed 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,6 +6,12 @@ pipeline: buildExpired: true validate: true url: https://staging.vbrandl.net + compress: + image: alpine:latest + script: + - apk --no-cache update + - apk add make + - make -C public/ -f Makefile deploy: image: drillster/drone-rsync hosts: [ "vbrandl.net" ] From 0ffe29e49096bfb084afa010eee769bdf5ed5c27 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 20 Jul 2018 12:59:20 +0200 Subject: [PATCH 6/9] Fix CI script --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index e1860ed..76d7207 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,7 +8,7 @@ pipeline: url: https://staging.vbrandl.net compress: image: alpine:latest - script: + commands: - apk --no-cache update - apk add make - make -C public/ -f Makefile From 613887a3c9e3a2e89330f43aec7c4a38f118a157 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 20 Jul 2018 13:00:22 +0200 Subject: [PATCH 7/9] Fix Makefile path --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 76d7207..c968d5a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,7 +11,7 @@ pipeline: commands: - apk --no-cache update - apk add make - - make -C public/ -f Makefile + - make -C public/ -f ../Makefile deploy: image: drillster/drone-rsync hosts: [ "vbrandl.net" ] From ba469c6ab4cbf3041af8419bfbd4818c6ce644f6 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 20 Jul 2018 13:03:33 +0200 Subject: [PATCH 8/9] Add prod build --- .drone.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.drone.yml b/.drone.yml index c968d5a..972e018 100644 --- a/.drone.yml +++ b/.drone.yml @@ -20,3 +20,26 @@ pipeline: user: hugo secrets: [ rsync_key ] branches: develop + +pipeline: + build: + image: cbrgm/drone-hugo:latest + buildDrafts: false + buildFuture: false + buildExpired: false + validate: true + url: https://www.vbrandl.net + compress: + image: alpine:latest + commands: + - apk --no-cache update + - apk add make + - make -C public/ -f ../Makefile + deploy: + image: drillster/drone-rsync + hosts: [ "vbrandl.net" ] + target: /var/www/vbrandl.net + source: public/* + user: hugo + secrets: [ rsync_key ] +branches: master From b1eaeb928be9b4b8d9c479c5e3c605e17c8055e7 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 20 Jul 2018 13:06:10 +0200 Subject: [PATCH 9/9] Implemend different build environments --- .drone.yml | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/.drone.yml b/.drone.yml index 972e018..9f1d35f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,45 +1,47 @@ pipeline: - build: + build-dev: image: cbrgm/drone-hugo:latest buildDrafts: true buildFuture: true buildExpired: true validate: true url: https://staging.vbrandl.net - compress: - image: alpine:latest - commands: - - apk --no-cache update - - apk add make - - make -C public/ -f ../Makefile - deploy: - image: drillster/drone-rsync - hosts: [ "vbrandl.net" ] - target: /var/www/staging.vbrandl.net - source: public/* - user: hugo - secrets: [ rsync_key ] -branches: develop + when: + branch: develop -pipeline: - build: + build-prod: image: cbrgm/drone-hugo:latest buildDrafts: false buildFuture: false buildExpired: false validate: true url: https://www.vbrandl.net + when: + branch: master + compress: image: alpine:latest commands: - apk --no-cache update - apk add make - make -C public/ -f ../Makefile - deploy: + + deploy-dev: + image: drillster/drone-rsync + hosts: [ "vbrandl.net" ] + target: /var/www/staging.vbrandl.net + source: public/* + user: hugo + secrets: [ rsync_key ] + when: + branch: develop + + deploy-prod: image: drillster/drone-rsync hosts: [ "vbrandl.net" ] target: /var/www/vbrandl.net source: public/* user: hugo secrets: [ rsync_key ] -branches: master + when: + branch: master