aqp-combi/Jenkinsfile

34 lines
1.0 KiB
Plaintext
Raw Normal View History

2024-09-09 17:06:56 +00:00
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') {
steps {
sh 'pnpm i'
}
}
stage('Build bundle') {
steps {
sh 'pnpm build'
}
}
stage('Deploy') {
steps {
2024-09-09 21:48:46 +00:00
// Clean previous deploy
sh 'rm -rf /var/www/combi/assets /var/www/combi/data /var/www/combi/n'
// Check if the tiles folder exists. If it does not,
// extract the tiles
2024-09-09 21:53:08 +00:00
def res = sh(script: "test -d ${target_dir}", returnStatus: true) == 0
2024-09-09 21:48:46 +00:00
if (res == '0') {
sh 'cp tiles.tar.gz /var/www/combi/'
sh 'tar -xf /var/www/combi/tiles.tar.gz -C /var/www/combi'
sh 'rm /var/www/combi/tiles.tar.gz'
}
2024-09-09 17:06:56 +00:00
sh 'cp -r ./dist/* /var/www/combi/'
}
}
}
}