这里把原来tryghost的blog全部迁移到hexo上面来了,新的方案使用github+travisCI+hexo。 说一下整体过程
- tryghost版本太老,nodejs基于0.10.x的版本,dependence里面有很多包都有漏洞但是无法升级。
- 新版本和老版本数据库不兼容。
- export tryghost backup.json
- 把json通过java解析,用fastjson,velocity 库转换成md模版
- import hexo,然后hexo clean ,hexo g集成
- github新建仓库zuoyun.me,设置blog-resouce 和master双分支
- 对master分支设置GitHub page 和 CNAME,域名重定向
- 对blog-resouce分支导入hexo和.travis.yml文件
- 生成github token在travis-ci里面配置对应的库,完成ci配置
- CNAME 文件放到 theme/next/source 下
language: node_js
node_js: v10.21.0
# S: Build Lifecycle
install:
- yarn install
cache:
yarn: true
apt: true
directories:
- node_modules # 缓存不经常更改的内容
script:
- hexo clean #清除
- hexo g
after_script:
- cd ./public
- git init
- git config user.name "chinajik"
- git config user.email "chinajik@gmail.com"
- git add .
- git commit -m "Update docs"
- git push --force --quiet "https://${token}@${GH_REF}" master:master
# E: Build LifeCycle
branches:
only:
- blog-resource
env:
global:
- GH_REF: github.com/jik1992/zuoyun.me.git