diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d0a0f7a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM maven:3.9.6-eclipse-temurin-17 AS build + +WORKDIR /app +COPY . . +RUN mvn package -DskipTest + +FROM eclipse-temurin:17-jre-noble as package +WORKDIR /app +COPY --from=build /app/target/sysfoo-*.jar ./sysfoo.jar +EXPOSE 8080 +ENTRYPOINT ["java", "-jar", "sysfoo.jar"] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..b9f2397 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,63 @@ +pipeline { + agent none + stages { + stage('build') { + agent { + docker { + image 'maven:3.9.6-eclipse-temurin-17' + } + + } + steps { + echo 'compile maven app' + sh 'mvn compile' + } + } + + stage('test') { + agent { + docker { + image 'maven:3.9.6-eclipse-temurin-17' + } + + } + steps { + echo 'test maven app' + sh 'mvn clean test' + } + } + + stage('package') { + parallel { + stage('package') { + agent { + docker { + image 'maven:3.9.6-eclipse-temurin-17' + } + + } + steps { + echo 'package maven app' + sh 'mvn package -DskipTests' + archiveArtifacts 'target/*.jar' + } + } + + stage('DOCKER BUILD') { + steps { + script { + def commitHash = env.GIT_COMMIT.take(7) + def dockerImage = docker.build("xxxxxx/sysfoo:${commitHash}", "./") + } + + } + } + + } + } + + } + tools { + maven '3.6.3' + } +} \ No newline at end of file diff --git a/README.md b/README.md index 6ae4ea5..6b0f158 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Sysfoo Application -A Devops Learning App - +A Devops Learning App test +adding someting to raise PR ## About the Application The Sysfoo application is designed as a learning tool to demonstrate various aspects of web development using Spring Boot and other associated technologies. It provides real-time system information, database connectivity status, and a basic to-do list functionality to illustrate interaction with a database.