diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 3c19591..a73c3d1 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -24,9 +24,14 @@ pipeline { 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' + // Copy launch file + sh 'cp run.sh /var/www/jerguero' - // run jar with pm2 - sh "pm2 start /var/www/jerguero/jerguero-0.0.1.jar --name ${env.JOB_NAME}" + // make launch file executable + sh 'chmod +x /var/www/jerguero/run.sh' + + // run launch file with pm2 + sh "pm2 start /var/www/jerguero/run.sh --name ${env.JOB_NAME}" // Save state sh 'pm2 save' } diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..8b5f544 --- /dev/null +++ b/run.sh @@ -0,0 +1,2 @@ +#!/bin/bash +java -jar jerguero-0.0.1.jar --server.port=8765 diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 75b4e83..e69de29 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +0,0 @@ -server.port=8765