From daf3d740ffc311d1f5da8959cfa480c63b31787e Mon Sep 17 00:00:00 2001 From: newnius Date: Thu, 1 Dec 2016 11:51:10 +0800 Subject: [PATCH] add git --- hexo/Dockerfile | 5 ++++- hexo/README.md | 8 +++++++- hexo/bootstrap.sh | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hexo/Dockerfile b/hexo/Dockerfile index 0465794..898fe32 100644 --- a/hexo/Dockerfile +++ b/hexo/Dockerfile @@ -9,7 +9,10 @@ RUN npm install hexo-generator-feed --save #Local Search RUN npm install hexo-generator-searchdb --save -RUN npm install --save hexo-algolia +RUN npm install --save hexo-algolia@0.2.0 + +RUN npm install hexo-deployer-git --save + ADD bootstrap.sh /etc/bootstrap.sh diff --git a/hexo/README.md b/hexo/README.md index c50c182..19620ad 100644 --- a/hexo/README.md +++ b/hexo/README.md @@ -3,7 +3,13 @@ https://hexo.io/zh-cn/ http://theme-next.iissnan.com/ First Time: -docker service create --name hexo --publish 4000:4000 --mount type=bind,source=/mnt/data/blog,target=/blog newnius/hexo +docker service create \ +--name hexo \ +--publish 4000:4000 \ +-e GIT_EMAIL="me@newnius.com" \ +-e GIT_NAME="newnius" \ +--mount type=bind,source=/mnt/data/blog,target=/blog \ +newnius/hexo Start Server: docker service create --name hexo --publish 4000:4000 --mount type=bind,source=/mnt/data/blog,target=/blog newnius/hexo /etc/bootstrap.sh server diff --git a/hexo/bootstrap.sh b/hexo/bootstrap.sh index 8f964b8..2b7a8c9 100755 --- a/hexo/bootstrap.sh +++ b/hexo/bootstrap.sh @@ -1,5 +1,8 @@ #! /bin/bash +git config --global user.email $GIT_EMAIL +git config --global user.name $GIT_NAME + if [ "$1" == "server" ]; then # start hexo server echo "starting hexo..."