Update jenkinsfile for docker jenkins build

This commit is contained in:
fernando 2024-11-09 16:58:57 +00:00
parent fda92bdc2a
commit e74f910d03

17
Jenkinsfile vendored
View File

@ -5,23 +5,26 @@ pipeline {
} }
stages { stages {
stage('Install deps') { stage('Install deps') {
agent {
docker {
reuseNode true
image 'node:22'
}
}
steps { steps {
sh 'npm i -g pnpm'
sh 'pnpm i' sh 'pnpm i'
}
}
stage('Build bundle') {
steps {
sh 'pnpm build' sh 'pnpm build'
} }
} }
stage('Deploy') { stage('Deploy') {
steps { steps {
// Clean previous deploy // 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, // Check if the tiles folder exists. If it does not,
// extract the tiles // extract the tiles
sh "if [ ! -d /var/www/combi/tiles ]; then \n tar -xf tiles.tar.gz -C /var/www/combi \n fi" 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/combi/' sh 'cp -r ./dist/* /var/www/dev.araozu.combi/'
} }
} }
} }