From 194eb318d11e17f877da3fddb2eef7127105817b Mon Sep 17 00:00:00 2001 From: Sejong Yoo Date: Fri, 11 Sep 2026 16:55:06 +0900 Subject: [PATCH] Set PATH for the remote deploy command. Non-login SSH sessions omit /usr/local/bin, where the NAS keeps docker. Co-authored-by: Cursor --- Jenkinsfile | 2 +- README.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6741642..9ab6e06 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -88,7 +88,7 @@ pipeline { execTimeout: 1800000, usePty: true, execCommand: """ - sudo -n su -c 'set -eu; cd "${env.DEPLOY_DIR}"; docker compose pull; docker compose up -d' + sudo -n su -c 'set -eu; export PATH=/usr/local/bin:/usr/bin:/bin; cd "${env.DEPLOY_DIR}"; docker compose pull; docker compose up -d' """.stripIndent().trim() ) ] diff --git a/README.md b/README.md index 2e216c1..235d16d 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,13 @@ sudo -n su -c 'whoami' `sudo -n`은 비밀번호를 묻지 않고, 설정이 안 되어 있으면 바로 실패합니다. Jenkinsfile에 비밀번호를 넣지 마세요. +비로그인 SSH의 PATH에는 `/usr/local/bin`이 없어서 시놀로지의 `docker`를 못 찾습니다. 그래서 배포 명령이 PATH를 직접 지정합니다. 다음이 같은 결과여야 합니다: + +```bash +ssh -T youruser@nas "sudo -n su -c 'export PATH=/usr/local/bin:/usr/bin:/bin; command -v docker'" +# /usr/local/bin/docker +``` + 서버 compose 경로는 Jenkinsfile `DEPLOY_DIR` (`/volume1/docker/sejong-office`)입니다. 이름이나 경로가 다르면 Jenkinsfile을 수정하면 됩니다. ### 서버 배포 체크리스트