Ariweb Suite 0.1.1 기반: 공통 라이브러리(db·http·세션·작업 엔진·할당/예약·알림·감사·보관소), 포털 뼈대, Webmaker/AriMail 도입 소스와 manifest
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
9ca4cee341
commit
c7aea8d419
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# 운영 폴더를 지정 브랜치로 맞추고, 실행 중인 AI 작업이 없을 때 서비스를 재시작한다.
|
||||
# 사용: deploy/deploy.sh [branch] (기본: 현재 브랜치)
|
||||
set -euo pipefail
|
||||
ROOT=/home/master/work/WebHoting_AI_Agent
|
||||
BRANCH=${1:-}
|
||||
cd "$ROOT"
|
||||
if [ -n "$BRANCH" ]; then
|
||||
if [ "$BRANCH" = "main" ]; then git checkout -q main; git reset -q --hard main;
|
||||
else git checkout -q --detach "$BRANCH"; fi # 다른 worktree 가 쓰는 브랜치도 detach 로 안전하게 배포
|
||||
fi
|
||||
# 작업 트리가 HEAD 와 다르면(다른 worktree 에서 같은 브랜치에 커밋된 경우) 강제로 맞춘다
|
||||
if ! git diff --quiet HEAD -- . ':!data'; then echo "작업 트리를 HEAD 에 맞춥니다"; git reset -q --hard HEAD; fi
|
||||
echo "deploying $(git log --oneline -1)"
|
||||
# 실행 중인 claude 작업 대기 (최대 20분)
|
||||
for i in $(seq 1 240); do
|
||||
if pgrep -u master -f "$HOME/.npm-global/bin/claude -p" >/dev/null 2>&1; then
|
||||
[ $((i % 12)) -eq 1 ] && echo "AI 작업이 실행 중입니다. 끝날 때까지 기다립니다… ($((i*5))s)"
|
||||
sleep 5
|
||||
else break; fi
|
||||
done
|
||||
# nginx 설정도 함께 반영 (오류 페이지·프록시 설정 변경 포함)
|
||||
if ! sudo cmp -s deploy/nginx-wmstats.conf /etc/nginx/conf.d/wmstats.conf; then sudo cp deploy/nginx-wmstats.conf /etc/nginx/conf.d/wmstats.conf && echo "nginx 통계 로그 형식 설치"; fi
|
||||
if ! sudo cmp -s deploy/nginx-webhosting.conf /etc/nginx/sites-available/webhosting; then sudo cp deploy/nginx-webhosting.conf /etc/nginx/sites-available/webhosting && sudo nginx -t && sudo systemctl reload nginx && echo "nginx 설정 갱신"; fi
|
||||
sudo cp deploy/webhosting-agent.service /etc/systemd/system/webhosting-agent.service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart webhosting-agent
|
||||
sleep 1
|
||||
systemctl --no-pager --lines=3 status webhosting-agent | head -5
|
||||
Reference in New Issue
Block a user