Update git remote and sync script to use local git server at fukun.net instead of GitHub
29 lines
800 B
Bash
29 lines
800 B
Bash
#!/usr/bin/env bash
|
|
# ============================================================
|
|
# sync-blog@tx-ubuntu-hugo.sh
|
|
# 拉取 Hugo 博客最新代码并重新构建静态页面
|
|
#
|
|
# 用法: claw run tx-ubuntu-hugo sync-blog@tx-ubuntu-hugo.sh
|
|
# 适用: Ubuntu 24.04, Hugo 0.161+
|
|
#
|
|
# 前置条件:
|
|
# - ~/hugo-blog 已 git clone 且 remote claw 指向 git@fukun.net:/data/git-repos/Hugo.git
|
|
# - hugo 已安装
|
|
# - nginx 指向 ~/hugo-blog/public
|
|
#
|
|
# 流程:
|
|
# 1. git pull claw master — 从本地 git 服务器拉取
|
|
# 2. hugo build — 重建静态页面到 public/
|
|
# ============================================================
|
|
set -e
|
|
|
|
cd ~/hugo-blog
|
|
|
|
echo ">>> git pull claw master..."
|
|
git pull claw master
|
|
|
|
echo ">>> hugo build..."
|
|
hugo --minify
|
|
|
|
echo ">>> done -- site updated"
|