From 6128453e3ac65bf27686ac63c110d431cef0bd43 Mon Sep 17 00:00:00 2001 From: lahari104 Date: Fri, 17 Feb 2023 18:10:50 +0530 Subject: [PATCH] added chnages --- Dockerfile | 10 ++++++++++ Jenkinsfile | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Jenkinsfile diff --git a/Dockerfile b/Dockerfile index e69de29bb..88a9aeed4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:20.04 as build +RUN apt update && \ + apt install openjdk-17-jdk -y && \ + apt install maven -y && \ + apt install git -y && \ + git clone https://github.com/spring-projects/spring-petclinic.git && \ + cd spring-petclinic && \ + ./mvnw package +EXPOSE 8080 +CMD [ "java", "-jar", "/spring-petclinic/target/spring-petclinic-3.0.0-SNAPSHOT.jar" ] \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..907e41a6c --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,22 @@ +pipeline{ + agent{ + label 'docker' + } + triggers{ + pollSCM('* * * * *') + } + parameters{ + choice(name: 'branch_name', choices: ['main', 'two', 'three'], description: 'selecting branch') + } + environment{ + dockerhub_registry_name = "lahari104" + image_name = "spc" + } + stages{ + stage('docker image build'){ + steps{ + sh 'docker image build -t spc:1.0 .' + } + } + } +}