#!/bin/bash set -euo pipefail # BUILD_NUMBER는 Jenkins가 주입 — 로컬 수동 실행 시엔 manual-시각 사용 ARCHIVE_NAME="chocomae-build-${BUILD_NUMBER:-manual-$(date +%Y%m%d%H%M%S)}.tar.gz" EXCLUDES=( ".DS_Store" ".git" ".idea" ".claude" ".gitignore" "__pycache__" "*.pyc" "node_modules" "venv" "*.zip" "*.tar" "*.tar.gz" "*.pdf" "*.psd" "*.log" "src/web/server/setup/service_db_setting.php" # phaser-input 플러그인 개발 아티팩트 (런타임은 build/phaser-input.min.js만 필요) "src/util/phaser-input-master/example" "src/util/phaser-input-master/ts" "src/util/phaser-input-master/config" "src/util/phaser-input-master/Gruntfile.js" "src/util/phaser-input-master/tslint.json" "src/util/phaser-input-master/package.json" "src/util/phaser-input-master/package-lock.json" # DB 초기 세팅 전용 — 웹 루트에 있으면 노출 위험 "src/web/sql" # deprecated 배치 스크립트 "src/php-cli/batch/old" # 백업/문서 "src/web/css/color_button_backup.css" "README.md" "SECURITY.md" "LICENSE" ) TAR_EXCLUDE_ARGS=() for pattern in "${EXCLUDES[@]}"; do TAR_EXCLUDE_ARGS+=(--exclude="${pattern}") done echo "=== 압축: ${ARCHIVE_NAME} ===" tar czf "${ARCHIVE_NAME}" "${TAR_EXCLUDE_ARGS[@]}" \ index.html \ src \ resources ls -lh "${ARCHIVE_NAME}"