From e44eea9f5dc106299e18ac23f63201d478995d6e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 23 Jul 2026 17:14:16 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B0=B0=ED=8F=AC=20=EC=8B=A4=ED=96=89=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=88=98=EC=A0=95=20DB=20=EB=8D=A4?= =?UTF-8?q?=ED=94=84=20=EC=9E=90=EB=8F=99=EC=8B=A4=ED=96=89=20=EC=B6=94?= =?UTF-8?q?=EA=B0=801?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/manual-deploy.yml | 2 +- DEPLOY_GITEA.md | 3 +++ scripts/deploy_remote.sh | 11 ++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/manual-deploy.yml b/.gitea/workflows/manual-deploy.yml index c5e0ccd..93efd3a 100644 --- a/.gitea/workflows/manual-deploy.yml +++ b/.gitea/workflows/manual-deploy.yml @@ -10,7 +10,7 @@ on: target_dir: description: Target directory on server required: true - default: /srv/egbim_homepage + default: ~/egbim db_dump_path: description: SQL dump path inside repository required: true diff --git a/DEPLOY_GITEA.md b/DEPLOY_GITEA.md index c7a4722..cd38e6d 100644 --- a/DEPLOY_GITEA.md +++ b/DEPLOY_GITEA.md @@ -108,6 +108,8 @@ Gitea 저장소 화면에서 아래 순서로 실행한다. 4. `branch` 와 `target_dir` 확인 후 실행 5. 최초 배포면 `db_dump_path` 를 `egbim_DB.sql` 로 유지 +현재 확인된 운영 배포 경로는 `~/egbim` 이다. + 워크플로는 서버에 SSH 접속해서 지정 디렉터리에 소스를 동기화하고 `docker compose up -d --build` 를 수행한다. 저장소 루트의 SQL 덤프가 있고 `.db_import_done` 마커가 없으면 최초 1회 DB import까지 수행한다. ## 4. Gitea Secrets @@ -132,6 +134,7 @@ Gitea 저장소 화면에서 아래 순서로 실행한다. 필요하면 아래도 수동 실행 입력값으로 바꿀 수 있다. - `target_dir`: 서버 배포 경로, 기본값 `/srv/egbim_homepage` +- `target_dir`: 서버 배포 경로, 기본값 `~/egbim` - `branch`: 기본값 `main` - `db_dump_path`: 기본값 `egbim_DB.sql` diff --git a/scripts/deploy_remote.sh b/scripts/deploy_remote.sh index 819acf0..606a1ee 100755 --- a/scripts/deploy_remote.sh +++ b/scripts/deploy_remote.sh @@ -2,11 +2,20 @@ set -euo pipefail branch="${1:-main}" -target_dir="${2:-/srv/egbim_homepage}" +target_dir="${2:-~/egbim}" env_file="${3:-}" db_dump_path="${4:-egbim_DB.sql}" db_import_marker=".db_import_done" +case "$target_dir" in + '~') + target_dir="$HOME" + ;; + '~/'*) + target_dir="$HOME/${target_dir#\~/}" + ;; +esac + mkdir -p "$target_dir" cd "$target_dir"