Commit Graph

416 Commits

Author SHA1 Message Date
Kazuhiro MUSASHI 769aa060a5
Merge pull request #37 from kazu634/leaflet-mapbox-js-support
Chapter3-2の記事を追加
2019-06-29 22:00:29 +07:00
Kazuhiro MUSASHI c6922beb3a Chapter3-2の記事を追加 2019-06-29 22:59:31 +08:00
Kazuhiro MUSASHI 9d6d065efe
Merge pull request #36 from kazu634/task-modify
Create the deploy tasks for production and staging
2019-06-29 18:35:07 +07:00
Kazuhiro MUSASHI a892daa154 Create the production deploy task. 2019-06-29 19:33:48 +08:00
Kazuhiro MUSASHI a93b333da9 Create staging deploy task. 2019-06-29 19:33:32 +08:00
Kazuhiro MUSASHI fc5d0a22c6 Separate the preparation part from the `build.rake`. 2019-06-29 19:33:32 +08:00
Kazuhiro MUSASHI 335757fb5c [WIP] ステージング・プロダクションデプロイ用タスクを作成する
ステージング・プロダクションデプロイ用タスクを作成する
2019-06-29 16:22:55 +08:00
Kazuhiro MUSASHI 4c1f37d94c
Merge pull request #35 from kazu634/article-on-sirocco
Siroccoの記事を追加
2019-06-23 15:18:54 +07:00
Kazuhiro MUSASHI 13b88e8d9e Siroccoの記事を追加 2019-06-23 15:16:01 +07:00
Kazuhiro MUSASHI 49721069d2
Merge pull request #34 from kazu634/travel-to-myanmmar
19番ストリートの記事を追加
2019-06-17 11:54:00 +07:00
Kazuhiro MUSASHI 635f817fe0 Change the article date. 2019-06-17 11:50:43 +07:00
Kazuhiro MUSASHI a07f2631d9 Add an image to the article. 2019-06-17 11:48:05 +07:00
Kazuhiro MUSASHI d74ef9f578 Add an article on the 19th Street. 2019-06-17 11:46:56 +07:00
Kazuhiro MUSASHI dc5454b89b
Merge pull request #33 from kazu634/modify-macos-rake-build-task
buildタスクをMac OS向けに修正する
2019-06-16 17:24:20 +07:00
Kazuhiro MUSASHI 522b11ce16 Mac OS向けにオプションを変更:
```
--- a/tasks/build.rake
+++ b/tasks/build.rake
@@ -24,12 +24,14 @@ task :build do
     if os == :linux
       sh 'grep -l -r ecx.images-amazon.com | sort | uniq | xargs --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"'
       sh 'grep -l -r "http://www.amazon.co.jp/exec" | sort | uniq | xargs --no-run-if-empty sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"'
+      sh 'find . -type f -name "*.mde" | xargs --no-run-if-empty rm || true'
+      sh 'find . -type f -name "*.md-e" | xargs --no-run-if-empty rm || true'
     else
-      sh 'grep -l -r ecx.images-amazon.com | sort | uniq | xargs d -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"'
-      sh 'grep -l -r "http://www.amazon.co.jp/exec" | sort | uniq | xargs sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"'
+      sh 'grep -l -r ecx.images-amazon.com . | sort | uniq | xargs d -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"'
+      sh 'grep -l -r "http://www.amazon.co.jp/exec" . | sort | uniq | xargs sed -i -e "s/http:\/\/www.amazon.co.jp\/exec/https:\/\/www.amazon.co.jp\/exec/g"'
+      sh 'find . -type f -name "*.mde" | xargs rm || true'
+      sh 'find . -type f -name "*.md-e" | xargs rm || true'
     end
-    sh 'find . -type f -name "*.mde" | xargs --no-run-if-empty rm || true'
-    sh 'find . -type f -name "*.md-e" | xargs --no-run-if-empty rm || true'
   end

   cd 'public' do
```
2019-06-16 17:23:16 +07:00
Kazuhiro MUSASHI 9743683075 [WIP] buildタスクをMac OS向けに修正する
`build`タスクをMac OS向けに修正します。
2019-06-16 17:21:27 +07:00
Kazuhiro MUSASHI fe4dbc39ec
Merge pull request #32 from kazu634/travel-to-myanmmar
シェダゴンパゴダの記事を追加
2019-06-16 17:11:16 +07:00
Kazuhiro MUSASHI 48be32af74 Shwedagon Pagoda article 2019-06-16 17:09:34 +07:00
Kazuhiro MUSASHI aa994ebede [WIP] ミャンマー旅行の記事を投稿します
ミャンマー旅行の記事を投稿するよ
2019-06-16 17:08:05 +07:00
Kazuhiro MUSASHI 43f3e5add6
Merge pull request #31 from kazu634/add-article-on-seikei-izumono-logistics3
星系出雲の兵站3の記事を追加
2019-05-26 22:29:06 +07:00
Kazuhiro MUSASHI f4deff094a Add Amazon Link. 2019-05-26 23:27:06 +08:00
Kazuhiro MUSASHI 6f8b71d2ab Add article on Seikei Izumo no Logistics3 2019-05-26 18:16:58 +07:00
Kazuhiro MUSASHI eef19019ee
Merge pull request #30 from kazu634/Modify-lego-article
WindowsのIISにSSL証明書を登録する場合についての記事を追加
2019-05-11 23:13:48 +07:00
Kazuhiro MUSASHI 85204c0fc4 Modify "How to Use Lego" article:
diff --git a/content/labs/infra/2019-04-14_how_to_use_Lego.md b/content/labs/infra/2019-04-14_how_to_use_Lego.md
index b6b6daf..b26a7a0 100644
--- a/content/labs/infra/2019-04-14_how_to_use_Lego.md
+++ b/content/labs/infra/2019-04-14_how_to_use_Lego.md
@@ -278,7 +278,7 @@ drwxr-xr-x 4 kazu634 kazu634 4.0K Mar 31 04:59 ..
 ```

 ### IISで利用する場合
-後で書く
+[Lego](https://github.com/go-acme/lego)ではうまくIISに登録できないことがわかったため、[WindowsサーバのIISにLet's Encryptで取得したワイルドカードSSL証明書をインポートする](https://blog.kazu634.com/labs/infra/2019-05-11-create-wildcard-ssl-certificate-on-windows/)を参照してください。

 ### ワイルドカード証明書が必要な場合
 [Amazon Route 53](https://aws.amazon.com/route53/)側で以下のようにレコードを作成する:
@@ -313,4 +313,4 @@ kazu634@ip-10-0-1-234% ./lego --dns route53 --domains "*.kazu634.com" --email si
 - [How to Import & Export SSL Certificates in IIS 7 | DigiCert](https://www.digicert.com/ssl-support/pfx-import-export-iis-7.htm)
 - [Importing & Exporting SSL Certificates In IIS 8 & IIS 8.5](https://www.digicert.com/ssl-support/pfx-import-export-iis-8.htm)
 - [IIS 10 Exporting/Importing SSL Certificates | digicert.com](https://www.digicert.com/ssl-support/certificate-pfx-file-export-import-iis-10.htm)
-
+- [WindowsサーバのIISにLet's Encryptで取得したワイルドカードSSL証明書をインポートする](https://blog.kazu634.com/labs/infra/2019-05-11-create-wildcard-ssl-certificate-on-windows/)
2019-05-12 00:12:00 +08:00
Kazuhiro MUSASHI 4b6f4b20bc Add an article on how to create wildcard SSL certificate on Windows. 2019-05-12 00:11:24 +08:00
Kazuhiro MUSASHI c2ca66e717
Merge pull request #29 from kazu634/support-staging-deploy
Staging環境へのデプロイをするように変更する
2019-05-06 10:15:34 +07:00
Kazuhiro MUSASHI c06b55ae44 Build the blog site for the staging environment:
```
--- a/tasks/build.rake
+++ b/tasks/build.rake
@@ -36,5 +36,5 @@ task :build do
     sh 'rm -rf *'
   end

-  sh 'hugo'
+  sh 'hugo -e staging -v'
 end
```
2019-05-06 11:13:44 +08:00
Kazuhiro MUSASHI 71876190b9 Deploy blog site to the staging environment:
```
--- a/tasks/deploy.rake
+++ b/tasks/deploy.rake
@@ -12,8 +12,6 @@ task :deploy => [:build] do
     end
   end

-  sh 'rsync -e "ssh -p 10022" -az --delete public webadm@10.0.1.234:~/works'
-
-  sh 'ssh -p 10022 webadm@10.0.1.234 "rm -rf /var/www/blog/*"'
-  sh 'ssh -p 10022 webadm@10.0.1.234 "cp -pr ~/works/public/* /var/www/blog/"'
+  sh 'ssh -p 10022 webadm@10.0.1.234 "rm -rf /var/www/test/*"'
+  sh 'rsync -e "ssh -p 10022" -rltvz --omit-dir-times --delete public/ webadm@10.0.1.234:/var/www/test'
 end
```
2019-05-06 11:12:44 +08:00
Kazuhiro MUSASHI 531736357b [WIP] To modify the task to deploy blog site to staging environment.
This is to modify the task to deploy blog site to staging environment.
2019-05-06 11:00:36 +08:00
Kazuhiro MUSASHI 19f7c9106a
Merge pull request #28 from kazu634/circleci-support
Modify minor typo...:
2019-05-04 21:10:51 +07:00
Kazuhiro MUSASHI 95532ed9a2 Modify minor typo...:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -18,7 +18,7 @@ jobs:
           name: "Run Hugo"
           working_directory: /root/project/
           command: |
-            if [ "${CIRCLE_BRANCH}" == "master" ]; then
+            if [ "${CIRCLE_BRANCH}" != "master" ]; then
               hugo -e staging -v -s /root/project/
             else
               hugo -e production -v -s /root/project/
```
2019-05-04 22:09:18 +08:00
Kazuhiro MUSASHI 05eb02e00a
Merge pull request #27 from kazu634/circleci-support
Change minor typo
2019-05-04 21:06:45 +07:00
Kazuhiro MUSASHI 5b8dae4a12 Change minor typo:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -49,7 +49,7 @@ jobs:
             ssh-keyscan -p ${SSHPORT} ${HOST_NAME} >> ~/.ssh/known_hosts

       - run:
-          name: Deploy (Not Master)
+          name: Deploy
           command: |
             if [ "${CIRCLE_BRANCH}" != "master" ]; then
               ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*"
```
2019-05-04 22:05:26 +08:00
Kazuhiro MUSASHI 3670452930
Merge pull request #26 from kazu634/circleci-support
Circleci support
2019-05-04 21:04:08 +07:00
Kazuhiro MUSASHI aca5778d06 Select deploy target, based on branch name:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -17,7 +17,12 @@ jobs:
       - run:
           name: "Run Hugo"
           working_directory: /root/project/
-          command: hugo -e staging -v -s /root/project/
+          command: |
+            if [ "${CIRCLE_BRANCH}" == "master" ]; then
+              hugo -e staging -v -s /root/project/
+            else
+              hugo -e production -v -s /root/project/
+            fi

       - run:
           name: Change Amazon Links
@@ -44,7 +49,12 @@ jobs:
             ssh-keyscan -p ${SSHPORT} ${HOST_NAME} >> ~/.ssh/known_hosts

       - run:
-          name: Deploy
+          name: Deploy (Not Master)
           command: |
-            ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*"
-            rsync -e "ssh -p ${SSHPORT}" --omit-dir-times -rltvz --delete public/ ${USER_NAME}@${HOST_NAME}:/var/www/test
+            if [ "${CIRCLE_BRANCH}" != "master" ]; then
+              ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*"
+              rsync -e "ssh -p ${SSHPORT}" --omit-dir-times -rltvz --delete public/ ${USER_NAME}@${HOST_NAME}:/var/www/test
+            else
+              ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/blog/*"
+              rsync -e "ssh -p ${SSHPORT}" --omit-dir-times -rltvz --delete public/ ${USER_NAME}@${HOST_NAME}:/var/www/blog
+            fi
```
2019-05-04 22:01:52 +08:00
Kazuhiro MUSASHI 6abf67e828 Specify the environment by hugo option:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -17,7 +17,7 @@ jobs:
       - run:
           name: "Run Hugo"
           working_directory: /root/project/
-          command: HUGO_ENV=staging hugo -v -s /root/project/
+          command: hugo -e staging -v -s /root/project/

       - run:
           name: Change Amazon Links
```
2019-05-04 21:55:31 +08:00
Kazuhiro MUSASHI 5ec3b74ae9 Change base url based on the environment:
```
--- a/layouts/partials/sections-definition.html
+++ b/layouts/partials/sections-definition.html
@@ -1,3 +1,3 @@
-          <li><a href="https://blog.kazu634.com/labs/">Labs</a></li>
-          <li><a href="https://blog.kazu634.com/quotes/">Quotes</a></li>
-          <li><a href="https://blog.kazu634.com/travel/">Travel</a></li>
+          <li><a href="{{ .Site.BaseURL }}/labs/">Labs</a></li>
+          <li><a href="{{ .Site.BaseURL }}/quotes/">Quotes</a></li>
+          <li><a href="{{ .Site.BaseURL }}/travel/">Travel</a></li>
```
2019-05-04 21:42:30 +08:00
Kazuhiro MUSASHI d24089860d Workaround for "failed to set permissions":
See: [rsync問題集 \- Qiita](https://qiita.com/xiaopihang/items/4e1cfed2a497f82d6bed)

```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -47,4 +47,4 @@ jobs:
           name: Deploy
           command: |
             ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*"
-            rsync -e "ssh -p ${SSHPORT}" --omit-dir-times -avz --delete public/ ${USER_NAME}@${HOST_NAME}:/var/www/test
+            rsync -e "ssh -p ${SSHPORT}" --omit-dir-times -rltvz --delete public/ ${USER_NAME}@${HOST_NAME}:/var/www/test
```
2019-05-04 21:37:20 +08:00
Kazuhiro MUSASHI 2395971119 Workaround for "failed to set times" error:
See [UNIX/rsync/ディレクトリの修正時間でパーミッションエラーが起きる \-
yanor\.net/wiki](http://yanor.net/wiki/?UNIX/rsync/%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E3%81%AE%E4%BF%AE%E6%AD%A3%E6%99%82%E9%96%93%E3%81%A7%E3%83%91%E3%83%BC%E3%83%9F%E3%83%83%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%8C%E8%B5%B7%E3%81%8D%E3%82%8B):

```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -47,4 +47,4 @@ jobs:
           name: Deploy
           command: |
             ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*"
-            rsync -e "ssh -p ${SSHPORT}" -az --delete public/ ${USER_NAME}@${HOST_NAME}:/var/www/test
+            rsync -e "ssh -p ${SSHPORT}" --omit-dir-times -avz --delete public/ ${USER_NAME}@${HOST_NAME}:/var/www/test
```
2019-05-04 21:32:52 +08:00
Kazuhiro MUSASHI 0c6f2c8368 Specify the environment when generating site:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -17,7 +17,7 @@ jobs:
       - run:
           name: "Run Hugo"
           working_directory: /root/project/
-          command: HUGO_ENV=production hugo -v -s /root/project/
+          command: HUGO_ENV=staging hugo -v -s /root/project/

       - run:
           name: Change Amazon Links
@@ -47,4 +47,4 @@ jobs:
           name: Deploy
           command: |
             ssh -p ${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*"
-            rsync -e "ssh -p ${SSHPORT}" -az --delete public ${USER_NAME}@${HOST_NAME}:/var/www/test
+            rsync -e "ssh -p ${SSHPORT}" -az --delete public/ ${USER_NAME}@${HOST_NAME}:/var/www/test
```
2019-05-04 21:30:35 +08:00
Kazuhiro MUSASHI 685e10db5c Add config file for staging. 2019-05-04 21:30:18 +08:00
Kazuhiro MUSASHI c67daed5be Deploy
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -6,14 +6,6 @@ jobs:

     steps:
       - checkout
-      - add_ssh_keys:
-          fingerprints:
-            - "7d:eb:56:da:3f:71:e1:fd:2f:c1:86:18:fe:08:8b:f9"
-      - run:
-          name: Start ssh-keyscan
-          command: |
-            ssh-keyscan -p ${SSHPORT} ${HOST_NAME} >> ~/.ssh/known_hosts
-
       - run:
           name: Change Amazon Links
           working_directory: /root/project/
@@ -42,3 +34,17 @@ jobs:
             do
               gzip -c ${TARGET} > ${TARGET}.gz
             done
+
+      - add_ssh_keys:
+          fingerprints:
+            - "7d:eb:56:da:3f:71:e1:fd:2f:c1:86:18:fe:08:8b:f9"
+      - run:
+          name: Start ssh-keyscan
+          command: |
+            ssh-keyscan -p ${SSHPORT} ${HOST_NAME} >> ~/.ssh/known_hosts
+
+      - run:
+          name: Deploy
+          command: |
+            ssh -p i${SSHPORT} ${USER_NAME}@${HOST_NAME} "rm -rf /var/www/test/*"
+            rsync -e "ssh -p ${SSHPORT}" -az --delete public ${USER_NAME}@${HOST_NAME}:/var/www/test
```
2019-05-04 21:15:31 +08:00
Kazuhiro MUSASHI 51ea68b3e3 Specify SSH port number:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -12,7 +12,7 @@ jobs:
       - run:
           name: Start ssh-keyscan
           command: |
-            ssh-keyscan ${HOST_NAME} >> ~/.ssh/known_hosts
+            ssh-keyscan -p ${SSHPORT} ${HOST_NAME} >> ~/.ssh/known_hosts

       - run:
           name: Change Amazon Links
```
2019-05-04 21:01:46 +08:00
Kazuhiro MUSASHI 46353b48e8 Use `egrep` instead of `find -regex`:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -38,7 +38,7 @@ jobs:
           name: "Gzip css/js/images"
           working_directory: /root/project/
           command: |
-            for TARGET in `find ./public/ -type f -regextype posix-egrep -regex ".*\.(css|js|png|jpg|JPG|PNG|CSS|JS)"`
+            for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`
             do
               gzip -c ${TARGET} > ${TARGET}.gz
             done
```
2019-05-04 20:57:38 +08:00
Kazuhiro MUSASHI 7caefb9317 Delete unnecessary line:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -38,7 +38,6 @@ jobs:
           name: "Gzip css/js/images"
           working_directory: /root/project/
           command: |
-            TARGETS=`find ./public/ -type f -regextype posix-egrep -regex ".*\.(css|js|png|jpg|JPG|PNG|CSS|JS)"
             for TARGET in `find ./public/ -type f -regextype posix-egrep -regex ".*\.(css|js|png|jpg|JPG|PNG|CSS|JS)"`
             do
               gzip -c ${TARGET} > ${TARGET}.gz
```
2019-05-04 20:53:45 +08:00
Kazuhiro MUSASHI c121f7db02 Specify `set +o pipefail`:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -18,6 +18,7 @@ jobs:
           name: Change Amazon Links
           working_directory: /root/project/
           command: |
+            set +o pipefail
             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"

@@ -30,6 +31,7 @@ jobs:
           name: Change Amazon Links
           working_directory: /root/project/
           command: |
+            set +o pipefail
             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"

       - run:
```
2019-05-04 20:51:41 +08:00
Kazuhiro MUSASHI 4f6f71f2f8 Add `working_directory`:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -16,21 +16,25 @@ jobs:

       - run:
           name: Change Amazon Links
+          working_directory: /root/project/
           command: |
             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"

       - run:
           name: "Run Hugo"
+          working_directory: /root/project/
           command: HUGO_ENV=production hugo -v -s /root/project/

       - run:
           name: Change Amazon Links
+          working_directory: /root/project/
           command: |
             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"

       - run:
           name: "Gzip css/js/images"
+          working_directory: /root/project/
           command: |
             TARGETS=`find ./public/ -type f -regextype posix-egrep -regex ".*\.(css|js|png|jpg|JPG|PNG|CSS|JS)"
             for TARGET in `find ./public/ -type f -regextype posix-egrep -regex ".*\.(css|js|png|jpg|JPG|PNG|CSS|JS)"`
```
2019-05-04 20:43:24 +08:00
Kazuhiro MUSASHI eaef25c364 Building the blog site:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -6,8 +6,34 @@ jobs:

     steps:
       - checkout
+      - add_ssh_keys:
+          fingerprints:
+            - "7d:eb:56:da:3f:71:e1:fd:2f:c1:86:18:fe:08:8b:f9"
+      - run:
+          name: Start ssh-keyscan
+          command: |
+            ssh-keyscan ${HOST_NAME} >> ~/.ssh/known_hosts
+
+      - run:
+          name: Change Amazon Links
+          command: |
+            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"
+
       - run:
           name: "Run Hugo"
           command: HUGO_ENV=production hugo -v -s /root/project/
-      - store_artifacts:
-          path: /root/project/public
+
+      - run:
+          name: Change Amazon Links
+          command: |
+            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"
+
+      - run:
+          name: "Gzip css/js/images"
+          command: |
+            TARGETS=`find ./public/ -type f -regextype posix-egrep -regex ".*\.(css|js|png|jpg|JPG|PNG|CSS|JS)"
+            for TARGET in `find ./public/ -type f -regextype posix-egrep -regex ".*\.(css|js|png|jpg|JPG|PNG|CSS|JS)"`
+            do
+              gzip -c ${TARGET} > ${TARGET}.gz
+            done
```
2019-05-04 20:40:10 +08:00
Kazuhiro MUSASHI dfd6e53df4 Change the path-to-public directory:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -10,4 +10,4 @@ jobs:
           name: "Run Hugo"
           command: HUGO_ENV=production hugo -v -s /root/project/
       - store_artifacts:
-          path: /tmp/artifacts
+          path: /root/project/public
```
2019-05-04 19:07:42 +08:00
Kazuhiro MUSASHI 9673dfe93e Use artifacts to see the results:
```
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -9,3 +9,5 @@ jobs:
       - run:
           name: "Run Hugo"
           command: HUGO_ENV=production hugo -v -s /root/project/
+      - store_artifacts:
+          path: /tmp/artifacts
```
2019-05-04 19:06:21 +08:00