add deploy script
This commit is contained in:
@@ -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}/"
|
||||||
Reference in New Issue
Block a user