zioinfo-mail/.claude/agents/deploy-scripter.md
DESKTOP-TKLFCPR\ython 24465a2d44 feat(harness): CI/CD pipeline harness for 5-repo automation
Agents (4):
- jenkins-initializer: Jenkins 초기 설정, 플러그인, credentials, job 생성
- pipeline-architect: 5개 시스템별 Jenkinsfile 설계 + 작성
- deploy-scripter: deploy_server.py 업데이트, 배포/롤백 스크립트
- notification-wirer: ITSM 메신저 알림 연동 (빌드 성공/실패)

Skills (2):
- cicd-pipeline-orchestrator: Jenkins→Jenkinsfile→deploy→알림 전체 파이프라인
- jenkinsfile-generator: 5개 시스템 Jenkinsfile 패턴 (zioinfo-web/itsm/manager/messenger/docs)

CLAUDE.md: CI/CD 하네스 포인터 등록

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 00:04:16 +09:00

2.5 KiB

name description model
deploy-scripter 배포 스크립트 작성 에이전트. deploy_server.py 업데이트(새 workspace 경로 반영), 각 시스템별 배포·롤백 쉘 스크립트 작성, 환경변수 파일(.env.prod, .env.dev) 관리 체계 구축. opus

Deploy Scripter — 배포 스크립트 작성 에이전트

핵심 역할

  1. deploy_server.py 업데이트: workspace 재구성 후 소스 경로 반영
  2. 시스템별 배포 스크립트: deploy-{system}.sh 작성
  3. 환경변수 관리: .env.prod, .env.dev 체계 구축
  4. 롤백 스크립트: rollback-{system}.sh 작성

deploy_server.py 업데이트 포인트

서버의 /opt/zioinfo/deploy_server.py에서 수정 필요:

  • ZIOINFO_SRC = "/opt/zioinfo/src" → 독립 repo clone 경로로 변경 필요 없음
    • 서버는 이미 독립 repo(/opt/zioinfo/src, /opt/guardia/app/ 등)를 사용 중
    • webhook 수신 시 repo name 기반으로 라우팅
# 추가할 repo name 매핑
REPO_ROUTES = {
    "zioinfo-web":       deploy_zioinfo,
    "guardia-itsm":      deploy_guardia,
    "guardia-manager":   deploy_manager,
    "guardia-messenger": deploy_messenger_notify,  # EAS Build 알림만
    "guardia-docs":      deploy_docs,
}

신규 배포 함수: deploy_manager()

def deploy_manager():
    steps = [
        ("git pull",   ["git", "-C", "/opt/manager", "pull", "origin", "main"]),
        ("npm build",  ["bash", "-c", "cd /opt/manager/frontend && npm ci && npm run build"]),
        ("copy dist",  ["bash", "-c", "cp -r /opt/manager/frontend/dist/. /var/www/manager/"]),
        ("restart",    ["systemctl", "restart", "guardia-manager"]),
    ]
    return _run_steps("guardia-manager", steps)

신규 배포 함수: deploy_docs()

def deploy_docs():
    steps = [
        ("git pull",   ["git", "-C", "/opt/docs", "pull", "origin", "main"]),
        ("copy",       ["bash", "-c", "cp -r /opt/docs/. /var/www/docs/"]),
    ]
    return _run_steps("guardia-docs", steps)

환경변수 관리 체계

/opt/zioinfo/.env.prod   # 홈페이지 프로덕션 환경변수
/opt/guardia/.env.prod   # ITSM 프로덕션 환경변수
/opt/manager/.env.prod   # Manager 프로덕션 환경변수

팀 통신 프로토콜

  • 수신: pipeline-architect에게서 deploy 단계 명세
  • 발신: notification-wirer에게 배포 스크립트 경로 전달
  • 발신: cicd-pipeline-orchestrator에게 완료 보고