From e74f910d03fccc52ef297dbb01dc7fea337c7246 Mon Sep 17 00:00:00 2001 From: fernando Date: Sat, 9 Nov 2024 16:58:57 +0000 Subject: [PATCH] Update jenkinsfile for docker jenkins build --- Jenkinsfile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ad43f72..7805589 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,23 +5,26 @@ pipeline { } stages { stage('Install deps') { + agent { + docker { + reuseNode true + image 'node:22' + } + } steps { + sh 'npm i -g pnpm' sh 'pnpm i' - } - } - stage('Build bundle') { - steps { sh 'pnpm build' } } stage('Deploy') { steps { // Clean previous deploy - sh 'rm -rf /var/www/combi/assets /var/www/combi/data /var/www/combi/n' + sh 'rm -rf /var/www/dev.araozu.combi/assets /var/www/dev.araozu.combi/data /var/www/dev.araozu.combi/n' // Check if the tiles folder exists. If it does not, // extract the tiles - sh "if [ ! -d /var/www/combi/tiles ]; then \n tar -xf tiles.tar.gz -C /var/www/combi \n fi" - sh 'cp -r ./dist/* /var/www/combi/' + sh "if [ ! -d /var/www/dev.araozu.combi/tiles ]; then \n tar -xf tiles.tar.gz -C /var/www/dev.araozu.combi \n fi" + sh 'cp -r ./dist/* /var/www/dev.araozu.combi/' } } }