Jenkinsfile season 4: the last change

Araozu 2023-11-08 06:10:21 -05:00
parent a09d9f2124
commit 1ce382786f
1 changed files with 5 additions and 4 deletions

View File

@ -20,11 +20,12 @@ pipeline {
PATH = "/var/lib/jenkins/.nvm/versions/node/v20.9.0/bin:${env.PATH}"
}
steps {
dir('/var/www/jerguero') {
// Remove previous deploy
sh 'rm /var/www/jerguero/* || true'
// Copy new deploy
sh 'cp /var/lib/jenkins/workspace/jerguero/target/jerguero-0.0.1.jar /var/www/jerguero'
// Change directory
dir('/var/www/jerguero') {
// run jar with pm2
sh "pm2 start jerguero-0.0.1.jar --name ${env.JOB_NAME}"
// Save state