jenkinsfile 2 episode 1
This commit is contained in:
parent
8cbdd6d7f9
commit
af78bd71c7
@ -20,16 +20,18 @@ pipeline {
|
|||||||
PATH = "/var/lib/jenkins/.nvm/versions/node/v20.9.0/bin:${env.PATH}"
|
PATH = "/var/lib/jenkins/.nvm/versions/node/v20.9.0/bin:${env.PATH}"
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
dir('/var/www/jerguero') {
|
// Remove previous deploy
|
||||||
// Remove previous deploy
|
sh 'rm /var/www/jerguero/* || true'
|
||||||
sh 'rm /var/www/jerguero/*'
|
// Copy new deploy
|
||||||
// Copy new deploy
|
sh 'cp /var/lib/jenkins/workspace/jerguero/target/jerguero-0.0.1.jar /var/www/jerguero'
|
||||||
sh 'cp /var/lib/jenkins/workspace/jerguero/target/jerguero-0.0.1.jar /var/www/jerguero'
|
sh 'whoami'
|
||||||
// run jar with pm2
|
// Change directory
|
||||||
sh "pm2 start jerguero-0.0.1.jar --name ${env.JOB_NAME}"
|
// dir('/var/www/jerguero') {
|
||||||
// Save state
|
// run jar with pm2
|
||||||
sh 'pm2 save'
|
sh "pm2 start /var/www/jerguero/jerguero-0.0.1.jar --name ${env.JOB_NAME}"
|
||||||
}
|
// Save state
|
||||||
|
sh 'pm2 save'
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user