supports jenkinsfile with dockerfile

This commit is contained in:
sukrucakmak 2023-03-20 00:39:31 +03:00
parent 33a55bf51b
commit 2afdb382b6

29
Jenkinsfile vendored
View file

@ -1,15 +1,18 @@
pipeline {
agent { dockerfile true }
stages {
stage('Build') {
steps {
sh 'mvn clean install'
}
}
stage('Test') {
steps {
sh 'java --version'
}
}
node {
stage("Clone the project") {
git branch: 'main', url: 'https://github.com/sukrucakmak/spring-petclinic.git'
}
stage("Compilation") {
sh "./mvnw clean install -DskipTests"
}
stage("Tests and Deployment") {
stage("Runing unit tests") {
sh "./mvnw test -Punit"
}
stage("Deployment") {
sh 'nohup ./mvnw spring-boot:run -Dserver.port=8001 &'
}
}
}