说明
把用了4年的Ghost切到了Hexo。为了更新自动化,制作了Docker镜像。
此Docker可以将公共或私有仓库Hexo Git源代码通过Webhook自动触发,并拉取并重新打包。
Docker Pull Command: docker pull funnyzak/hexo-webhook
Webhook Url: http://hostname:9000/hooks/hexo-webhook
Available Configuration Parameters
The following flags are a list of all the currently supported options that can be changed by passing in the variables to docker with the -e flag.
- USE_HOOK : The web hook is enabled as long as this is present.
- GIT_REPO : URL to the repository containing your source code
- GIT_BRANCH : Select a specific branch (optional)
- GIT_EMAIL : Set your email for code pushing (required for git to work)
- GIT_NAME : Set your name for code pushing (required for git to work)
- WEBHOOK_LIST : Optional. Notify link array that send notifications when pull code, each link is separated by |
- HOOK_NAME : Optional. When setting WEBHOOK_LIST, it is best to set a HOOK name
Volume Configuration
- /app/target : builded code files will move to this folder.
- /app/code : source code dir. Will automatically pull the code.
- /root/.ssh : If it is a private repository, please set ssh key
ssh-keygen
ssh-keygen -t rsa -b 4096 -C "[email protected]" -N "" -f ./id_rsa
Docker-Compose
1 | version: '3' |
Nginx
1 | server { |
Please configure according to the actual deployment path and port.