Jenkinsfile
This commit is contained in:
parent
5d1017f0be
commit
1acb22e1fe
36
Jenkinsfile.groovy
Normal file
36
Jenkinsfile.groovy
Normal file
@ -0,0 +1,36 @@
|
||||
// Simple pipeline for deploying spring
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Stop previous deploy') {
|
||||
environment {
|
||||
PATH = "/var/lib/jenkins/.nvm/versions/node/v20.9.0/bin:${env.PATH}"
|
||||
}
|
||||
steps {
|
||||
sh "pm2 stop ${env.JOB_NAME}"
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh './mvnw clean package'
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
environment {
|
||||
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/*'
|
||||
// Copy new deploy
|
||||
sh 'cp /var/lib/jenkins/workspace/jerguero/target/jerguero-0.0.1.jar /var/www/jerguero'
|
||||
// run jar with pm2
|
||||
sh "pm2 start jerguero-0.0.1.jar --name ${env.JOB_NAME}"
|
||||
// Save state
|
||||
sh 'pm2 save'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
2
pom.xml
2
pom.xml
@ -10,7 +10,7 @@
|
||||
</parent>
|
||||
<groupId>dev.araozu</groupId>
|
||||
<artifactId>jerguero</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<version>0.0.1</version>
|
||||
<name>jerguero</name>
|
||||
<description>jerguero</description>
|
||||
<properties>
|
||||
|
@ -12,7 +12,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="bg-teal-900 text-white rounded-xl p-4 m-4 shadow">
|
||||
<p th:text="|Oh hi, ${name}, thanks for checking in, i'm|"/>
|
||||
<p th:text="|Oh hi ${name}, thanks for checking in, i'm|"/>
|
||||
<p class="bg-white text-teal-900 p-2 my-2 rounded-xl shadow-inner">
|
||||
still a piece of garbage
|
||||
</p>
|
||||
|
Loading…
Reference in New Issue
Block a user