pipeline { agent any environment { PATH = "/var/lib/jenkins/bin:/var/lib/jenkins/.nvm/versions/node/v20.9.0/bin:${env.PATH}" } stages { stage('Install deps') { agent { docker { reuseNode true image 'node:22' } } steps { sh 'npm i -g pnpm' sh 'pnpm i' sh 'pnpm build' } } stage('Deploy') { steps { // Clean previous deploy 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/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/' } } } }