diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..b3c334ce2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM openjdk:8-alpine + +COPY target/spring-petclinic-2.0.0.jar /opt/spring-petclinic.jar + +EXPOSE 8080 + +CMD java -Djava.security.egd=file:/dev/./urandom -jar /opt/spring-petclinic.jar \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..4c2ccd0de --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,35 @@ +pipeline { + + agent any + + options { + // Keep only 1 artifact, and many builds + buildDiscarder(logRotator(numToKeepStr: '1000', artifactNumToKeepStr: '0')) + } + + stages { + + stage('Build the code') { + steps { + script { + docker.image('openjdk:8-jdk-alpine').inside('-v /var/jenkins_home/.m2:/root/.m2') { + sh ''' + ./mvnw clean package -DskipTests -T 2 + ''' + } + } + + } + } + + stage('Build the image') { + steps { + script { + docker.build("loxon/petclinic:2.0.0").push() + } + } + } + + } + +} \ No newline at end of file diff --git a/test.txt b/test.txt new file mode 100644 index 000000000..e69de29bb