From 61e5e51ffaa49d21b3e7f75b39ad3b7fa17307fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=BA=90?= Date: Thu, 27 Aug 2026 18:02:28 +0800 Subject: [PATCH] add deploy script --- deploy.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..4efbff3 --- /dev/null +++ b/deploy.sh @@ -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}/"