add deploy script

This commit is contained in:
王源
2026-08-27 18:02:28 +08:00
parent 46851ef3c2
commit 61e5e51ffa
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
# === Moboos Ad Report 一键部署脚本 ===
# 在 moboos-ad-report 目录下执行:bash deploy.sh
set -e
REPO_NAME="moboos-ad-report"
USER="wangyuan"
TOKEN="51fa1035659e6d267beffcd08af5ec7168efe4df"
GIT_HOST="git.ops.roasbloom.site"
echo ">>> Step 1: 建仓库..."
curl -s -X POST "https://${GIT_HOST}/api/v1/user/repos" \
-H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"name\":\"${REPO_NAME}\",\"private\":true}" \
-o /tmp/create_repo_resp.json -w "\nHTTP %{http_code}\n"
echo "响应:"
cat /tmp/create_repo_resp.json | head -5
echo ""
echo ">>> Step 2: 初始化 git 并推送..."
git init
git add index.html data.json update.sh schedule.conf
git commit -m "init: moboos ad report"
git remote add origin "https://${USER}:${TOKEN}@${GIT_HOST}/${USER}/${REPO_NAME}.git"
git push -u origin main || git push -u origin master
echo ""
echo "=== 部署完成 ==="
echo "报告网址:https://ops.roasbloom.site/${REPO_NAME}/"