1

终于吧 blog 的自动构建 pipeline 配置好了 - Est's Blog

 2 years ago
source link: https://blog.est.im/2022/stdout-07
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

终于吧 blog 的自动构建 pipeline 配置好了

Posted 2022-07-19 | stdout

目前博客是基于 pelican 的 static-site generator,一个 python 模块本地渲染成静态文件然后通过 github pages 发布。

源码放在 bitbucket,之前比较懒都是本地跑,一直想改成 CI/CD pipeline,今天终于配置好了。记录一些坑吧

  1. bitbucket pipeline 不通 step 之间数据是不共享的。本来想用 parallel 功能在下载 pip 模块和 git clone 皮肤做个并行,后来发现 artifact 拷贝速度还不如串行去跑。就所有步奏一个 step 坐完罢了
  2. 博客源码和生成结果可以直接同步提交信息:
    msg=$(git log -1 --pretty=%B)
    cd output
    git config user.name est
    git config user.email 邮箱
    git add .
    git commit -m "$msg"
    git push
  3. 由于 pip 模块装了不知道在哪里,所以调试 pip 安装路径方法:
    python -c 'import site; print(*site.getsitepackages(), sep="\n")'
  4. pelican 默认居然没支持 Markdown 也是醉了
    python -m pip install pelican==4.8.0 Markdown
  5. 自定义皮肤依赖,由于 submodule 我没玩转,所以这样安装:
    git clone --depth=1 [email protected]:est/aether-pelican.git || (cd aether-pelican; git pull --rebase)

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK