From 7ecaa922a966670a27bd62b166938742d6297102 Mon Sep 17 00:00:00 2001 From: kazu634 Date: Sun, 16 Feb 2020 19:20:19 +0700 Subject: [PATCH 01/14] bump the hugo docker image to 0.64.1 --- .drone.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index dc420b5..98c2483 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,18 +4,18 @@ name: production steps: - name: Modify-Amazon-Links - image: cibuilds/hugo:0.62.1 + image: cibuilds/hugo:0.64.1 commands: - grep -l -r ecx.images-amazon.com content/ | sort | uniq | xargs -t --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g" - grep -l -r "http://www.amazon.co.jp/exec" content/ | sort | uniq | xargs -t --no-run-if-empty sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g" - name: hugo - image: cibuilds/hugo:0.62.1 + image: cibuilds/hugo:0.64.1 commands: - hugo -e production -v -s . - name: Compress-the-Assets - image: cibuilds/hugo:0.62.1 + image: cibuilds/hugo:0.64.1 commands: - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do rm -f ${TARGET}; done @@ -58,18 +58,18 @@ name: staging steps: - name: Modify-Amazon-Links - image: cibuilds/hugo:0.62.1 + image: cibuilds/hugo:0.64.1 commands: - grep -l -r ecx.images-amazon.com content/ | sort | uniq | xargs -t --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g" - grep -l -r "http://www.amazon.co.jp/exec" content/ | sort | uniq | xargs -t --no-run-if-empty sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g" - name: hugo - image: cibuilds/hugo:0.62.1 + image: cibuilds/hugo:0.64.1 commands: - hugo -e staging -v -s . - name: Compress-the-Assets - image: cibuilds/hugo:0.62.1 + image: cibuilds/hugo:0.64.1 commands: - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do rm -f ${TARGET}; done From f068ad3c328587f0100527948c9c519f937e32d5 Mon Sep 17 00:00:00 2001 From: kazu634 Date: Sun, 16 Feb 2020 20:06:51 +0700 Subject: [PATCH 02/14] Specify hugo cache directory --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 98c2483..c052bfd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,7 +12,7 @@ steps: - name: hugo image: cibuilds/hugo:0.64.1 commands: - - hugo -e production -v -s . + - hugo -e production -v -s --cacheDir /tmp . - name: Compress-the-Assets image: cibuilds/hugo:0.64.1 @@ -66,7 +66,7 @@ steps: - name: hugo image: cibuilds/hugo:0.64.1 commands: - - hugo -e staging -v -s . + - hugo -e staging -v -s --cacheDir /tmp . - name: Compress-the-Assets image: cibuilds/hugo:0.64.1 From 351fe32f8a7d48be2a40183a5daa68559b58ebe2 Mon Sep 17 00:00:00 2001 From: kazu634 Date: Sun, 16 Feb 2020 20:13:08 +0700 Subject: [PATCH 03/14] Modify the order of the flags --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index c052bfd..f7aafb2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,7 +12,7 @@ steps: - name: hugo image: cibuilds/hugo:0.64.1 commands: - - hugo -e production -v -s --cacheDir /tmp . + - hugo --cacheDir /tmp -e staging -v -s . - name: Compress-the-Assets image: cibuilds/hugo:0.64.1 @@ -66,7 +66,7 @@ steps: - name: hugo image: cibuilds/hugo:0.64.1 commands: - - hugo -e staging -v -s --cacheDir /tmp . + - hugo --cacheDir /tmp -e staging -v -s . - name: Compress-the-Assets image: cibuilds/hugo:0.64.1 From a7fc74d3821d685dd0b5dd1824105bdcb556f630 Mon Sep 17 00:00:00 2001 From: kazu634 Date: Sun, 16 Feb 2020 20:17:35 +0700 Subject: [PATCH 04/14] hugo docker image debug: permission check --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index f7aafb2..3f7accd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,6 +12,7 @@ steps: - name: hugo image: cibuilds/hugo:0.64.1 commands: + - ls -lR . - hugo --cacheDir /tmp -e staging -v -s . - name: Compress-the-Assets From 2b71e7680bdb34cd5a3cd0a5e71f4be2c84d9355 Mon Sep 17 00:00:00 2001 From: kazu634 Date: Sun, 16 Feb 2020 20:18:10 +0700 Subject: [PATCH 05/14] hugo docker image check: permission - 2 --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index 3f7accd..2d77d94 100644 --- a/.drone.yml +++ b/.drone.yml @@ -67,6 +67,7 @@ steps: - name: hugo image: cibuilds/hugo:0.64.1 commands: + - ls -lR . - hugo --cacheDir /tmp -e staging -v -s . - name: Compress-the-Assets From a0153469f05faae827122f317dca02f774fed88d Mon Sep 17 00:00:00 2001 From: kazu634 Date: Sun, 16 Feb 2020 20:22:46 +0700 Subject: [PATCH 06/14] hugo docker image check: user & current directory --- .drone.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2d77d94..31f7017 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,7 +12,6 @@ steps: - name: hugo image: cibuilds/hugo:0.64.1 commands: - - ls -lR . - hugo --cacheDir /tmp -e staging -v -s . - name: Compress-the-Assets @@ -67,7 +66,7 @@ steps: - name: hugo image: cibuilds/hugo:0.64.1 commands: - - ls -lR . + - pwd && id & ls -lR /drone/src - hugo --cacheDir /tmp -e staging -v -s . - name: Compress-the-Assets From 1bcd800ed7b078604fc72953e76715c92a274b3c Mon Sep 17 00:00:00 2001 From: kazu634 Date: Sun, 16 Feb 2020 20:25:48 +0700 Subject: [PATCH 07/14] Add `sudo` command in front of `hugo` --- .drone.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 31f7017..534a222 100644 --- a/.drone.yml +++ b/.drone.yml @@ -66,8 +66,7 @@ steps: - name: hugo image: cibuilds/hugo:0.64.1 commands: - - pwd && id & ls -lR /drone/src - - hugo --cacheDir /tmp -e staging -v -s . + - sudo hugo -e staging -v -s . - name: Compress-the-Assets image: cibuilds/hugo:0.64.1 From ed2f61f63d13b6e1014e8f38aa94d097b9a9cdf4 Mon Sep 17 00:00:00 2001 From: kazu634 Date: Sun, 16 Feb 2020 20:31:17 +0700 Subject: [PATCH 08/14] Specify the OS user to execute CI --- .drone.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 534a222..7f64407 100644 --- a/.drone.yml +++ b/.drone.yml @@ -58,17 +58,20 @@ name: staging steps: - name: Modify-Amazon-Links + user: root image: cibuilds/hugo:0.64.1 commands: - grep -l -r ecx.images-amazon.com content/ | sort | uniq | xargs -t --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g" - grep -l -r "http://www.amazon.co.jp/exec" content/ | sort | uniq | xargs -t --no-run-if-empty sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g" - name: hugo + user: root image: cibuilds/hugo:0.64.1 commands: - - sudo hugo -e staging -v -s . + - hugo -e staging -v -s . - name: Compress-the-Assets + user: root image: cibuilds/hugo:0.64.1 commands: - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done From 6cb3aae73955715d86bad1d01bb2c07954a3b85c Mon Sep 17 00:00:00 2001 From: kazu634 Date: Sun, 16 Feb 2020 20:33:45 +0700 Subject: [PATCH 09/14] hugo docker check: specify cache directory again --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 7f64407..02893cd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -68,7 +68,7 @@ steps: user: root image: cibuilds/hugo:0.64.1 commands: - - hugo -e staging -v -s . + - hugo --cacheDir /tmp -e staging -v -s . - name: Compress-the-Assets user: root From 26a55c7c8183d1ce33bc8cfab4da045d1c1f5118 Mon Sep 17 00:00:00 2001 From: kazu634 Date: Sun, 16 Feb 2020 20:35:24 +0700 Subject: [PATCH 10/14] Add `sudo` again --- .drone.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 02893cd..f6277ba 100644 --- a/.drone.yml +++ b/.drone.yml @@ -65,10 +65,9 @@ steps: - grep -l -r "http://www.amazon.co.jp/exec" content/ | sort | uniq | xargs -t --no-run-if-empty sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g" - name: hugo - user: root image: cibuilds/hugo:0.64.1 commands: - - hugo --cacheDir /tmp -e staging -v -s . + - sudo hugo -e staging -v -s . - name: Compress-the-Assets user: root From 5f42d932716e445cf53f7e9b300c1e005b09f19f Mon Sep 17 00:00:00 2001 From: kazu634 Date: Sun, 16 Feb 2020 20:38:15 +0700 Subject: [PATCH 11/14] Add `sudo` to all the lines --- .drone.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index f6277ba..5695f50 100644 --- a/.drone.yml +++ b/.drone.yml @@ -70,11 +70,10 @@ steps: - sudo hugo -e staging -v -s . - name: Compress-the-Assets - user: root image: cibuilds/hugo:0.64.1 commands: - - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done - - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do rm -f ${TARGET}; done + - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do sudo gzip -c ${TARGET} > ${TARGET}.gz; done + - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do sudo rm -f ${TARGET}; done - name: housekeep image: appleboy/drone-ssh From 9ed38ea0b855f071a088d6115faa1f06019c6d2f Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 16 Feb 2020 22:56:50 +0800 Subject: [PATCH 12/14] Use `alpine:3.9` docker image. --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5695f50..444d443 100644 --- a/.drone.yml +++ b/.drone.yml @@ -59,7 +59,7 @@ name: staging steps: - name: Modify-Amazon-Links user: root - image: cibuilds/hugo:0.64.1 + image: alpine:3.9 commands: - grep -l -r ecx.images-amazon.com content/ | sort | uniq | xargs -t --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g" - grep -l -r "http://www.amazon.co.jp/exec" content/ | sort | uniq | xargs -t --no-run-if-empty sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g" @@ -70,7 +70,7 @@ steps: - sudo hugo -e staging -v -s . - name: Compress-the-Assets - image: cibuilds/hugo:0.64.1 + image: alpine:3.9 commands: - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do sudo gzip -c ${TARGET} > ${TARGET}.gz; done - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do sudo rm -f ${TARGET}; done From 3e1b3d2f3f301aaf0b4892266e2917f01fbfae3a Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 16 Feb 2020 23:01:30 +0800 Subject: [PATCH 13/14] Delete `sudo` command. --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 444d443..d94cc39 100644 --- a/.drone.yml +++ b/.drone.yml @@ -72,8 +72,8 @@ steps: - name: Compress-the-Assets image: alpine:3.9 commands: - - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do sudo gzip -c ${TARGET} > ${TARGET}.gz; done - - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do sudo rm -f ${TARGET}; done + - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done + - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do rm -f ${TARGET}; done - name: housekeep image: appleboy/drone-ssh From f349d21677f90b60e7002487f0865cd981905b3c Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 16 Feb 2020 23:08:57 +0800 Subject: [PATCH 14/14] Modify production part as well. --- .drone.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index d94cc39..3807f5e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ name: production steps: - name: Modify-Amazon-Links - image: cibuilds/hugo:0.64.1 + image: alpine:3.9 commands: - grep -l -r ecx.images-amazon.com content/ | sort | uniq | xargs -t --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g" - grep -l -r "http://www.amazon.co.jp/exec" content/ | sort | uniq | xargs -t --no-run-if-empty sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g" @@ -12,10 +12,10 @@ steps: - name: hugo image: cibuilds/hugo:0.64.1 commands: - - hugo --cacheDir /tmp -e staging -v -s . + - sudo hugo -e production -v -s . - name: Compress-the-Assets - image: cibuilds/hugo:0.64.1 + image: alpine:3.9 commands: - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done - for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do rm -f ${TARGET}; done @@ -58,7 +58,6 @@ name: staging steps: - name: Modify-Amazon-Links - user: root image: alpine:3.9 commands: - grep -l -r ecx.images-amazon.com content/ | sort | uniq | xargs -t --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"