From 1bbb3f0ea8f2e3ab463f7ff455da09326576c921 Mon Sep 17 00:00:00 2001 From: Araozu Date: Wed, 8 Nov 2023 06:29:12 -0500 Subject: [PATCH] jenkinsfile 2 alyx --- Jenkinsfile.groovy | 9 +++++++-- run.sh | 2 ++ src/main/resources/application.properties | 1 - 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 run.sh 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