Add Dockerfile and Jenkinsfile

This commit is contained in:
Viktoriia Karpenko 2024-12-11 16:39:00 +02:00
parent 22caee3d03
commit b51b95031b
2 changed files with 28 additions and 0 deletions

17
Dockerfile Normal file
View file

@ -0,0 +1,17 @@
FROM maven:3.9.9-eclipse-temurin-17 AS builder
WORKDIR /build
COPY . .
RUN ./mvnw package -DskipTests
FROM eclipse-temurin:21-jdk-jammy
WORKDIR /app
COPY --from=builder build/target/spring-petclinic-4.0.1.jar /app/spring-petclinic.jar
ENTRYPOINT ["java", "-jar", "/app/spring-petclinic.jar"]
EXPOSE 8080

11
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,11 @@
pipeline {
agent any
stages {
stage ('Checkstyle') {
steps {
sh 'mvn validate'
archiveArtifacts artifacts: 'target/checkstyle-report.xml', allowEmptyArchive: true
}
}
}
}