diff --git a/Jenkinsfile b/Jenkinsfile index aa00b8d..ed2c5a5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,7 @@ pipeline { // 빌드 에이전트가 특정 레이블을 가지고 있다면 여기에 지정 // label 'your-jenkins-agent-label' tools { - nodejs 'NodeJS 18' // 'NodeJS 18'은 위에서 설정한 Node.js installation의 이름입니다. + nodejs 'nodejs23' // 'NodeJS 18'은 위에서 설정한 Node.js installation의 이름입니다. } } @@ -53,15 +53,13 @@ pipeline { stage('Install Dependencies and Build (SvelteKit)') { steps { - // 이제 'npm' 명령어를 직접 호출할 수 있습니다. - // Jenkins Node.js 플러그인이 PATH를 자동으로 설정해줍니다. - // --prefix . 옵션은 현재 디렉토리에 node_modules를 설치하라는 의미입니다. - // --cache 옵션은 Jenkins 에이전트의 로컬 캐시를 사용하게 됩니다. - // Jenkins 에이전트에 대한 전역 캐시 경로가 따로 없다면, 이 옵션을 제거하거나 Jenkins 에이전트의 적절한 캐시 경로를 지정해야 합니다. - // 일반적으로는 이 옵션 없이 `npm install`만으로도 충분합니다. - sh "npm install" // --prefix . --cache ${env.REMOTE_NPM_CACHE_DIR} 부분을 제거하고 먼저 시도 - sh "npm run build" - echo "SvelteKit project built successfully." + sh ''' + source ~/.nvm/nvm.sh # nvm 설치 경로에 따라 달라질 수 있음 + nvm use 23 # 사용하려는 Node.js 버전 + npm install + npm run build + ''' + echo "SvelteKit project built successfully." } }