From a0045854f88c8327a63b6c0fb249cbb7051ee73a Mon Sep 17 00:00:00 2001 From: dihwang Date: Mon, 13 Apr 2026 14:15:49 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20run.sh=20=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=EB=A1=9C=20=EC=95=B1=20=EC=8B=A4=ED=96=89=20=EA=B0=84?= =?UTF-8?q?=EC=86=8C=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: aider (gemini/gemini-2.5-flash) --- deployment.md | 14 +++++++++++--- run.sh | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 run.sh diff --git a/deployment.md b/deployment.md index b108347..43c5a1a 100644 --- a/deployment.md +++ b/deployment.md @@ -50,13 +50,21 @@ htpasswd /etc/nginx/.htpasswd anotheruser ## 4. VaultKeeper 실행 -`config.json` 파일 생성 및 `.htpasswd` 파일 준비가 완료되면, 빌드된 VaultKeeper 바이너리를 실행합니다. +`config.json` 파일 생성 및 `.htpasswd` 파일 준비가 완료되면, `run.sh` 스크립트를 사용하여 VaultKeeper를 쉽게 빌드하고 실행할 수 있습니다. + +먼저, `run.sh` 파일에 실행 권한을 부여합니다: ```bash -./vaultkeeper +chmod +x run.sh ``` -VaultKeeper는 `config.json`에 설정된 포트에서 수신 대기합니다 (기본값: 8000번 포트). +그 다음, 다음 명령어를 실행하여 VaultKeeper를 시작합니다: + +```bash +./run.sh +``` + +`run.sh` 스크립트는 Go 바이너리를 빌드하고 실행합니다. VaultKeeper는 `config.json`에 설정된 포트에서 수신 대기합니다 (기본값: 8000번 포트). ## 5. Nginx 설정 예시 diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..4f495f2 --- /dev/null +++ b/run.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# 백엔드 빌드 +echo "VaultKeeper 백엔드를 빌드합니다..." +go build -o vaultkeeper -ldflags "-s -w" main.go + +if [ $? -ne 0 ]; then + echo "빌드 실패." + exit 1 +fi + +echo "빌드 성공. VaultKeeper를 실행합니다..." +echo "-----------------------------------" + +# VaultKeeper 실행 +./vaultkeeper