34 lines
1.1 KiB
Bash
34 lines
1.1 KiB
Bash
#!/bin/bash
|
|
# === Voypace Ad Report 一键部署脚本 ===
|
|
# 在 voypace-ad-report 目录下执行:bash deploy.sh
|
|
|
|
set -e
|
|
|
|
REPO_NAME="voypace-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 mtg_data.json orders.json campaigns.json matrix_overrides.json \
|
|
db_fetch.py excel_fetch.py adscenter_daily_sync.py seed_from_sheet4.py
|
|
git commit -m "init: voypace 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}/"
|