From b694f3bac287c9dca8f15f9494c404dd860382bc Mon Sep 17 00:00:00 2001 From: vishnu1411 Date: Sat, 16 Dec 2023 14:12:41 -0500 Subject: [PATCH] Jenkinsfile_DB --- Dockerfile | 11 +++++++++++ Jenkinsfile | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..1bbf0f70b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +# Use an official Maven runtime as a parent image +FROM maven:3.8.4-openjdk-17-slim AS build + +# Set the working directory in the container +WORKDIR /app + +# Copy the compiled JAR file from the build stage +COPY target/*.jar /app/petclinic.jar + +# Specify the command to run on container start +CMD ["java", "-jar", "petclinic.jar"] \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 55d2b642d..adc152779 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,6 +19,14 @@ pipeline { } } + stage('Build a Docker Image') { + steps { + // Build a Docker image + script { + docker.build('petclinic:auto') + } + } + } stage ('Archive test results') { steps { //Archive the test results