diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..985392f5 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,35 @@ +pipeline { + agent { + docker { + image 'maven:3.6.3-jdk-11-slim' + } + + } + stages { + stage('build') { + steps { + echo 'compile maven app' + sh 'mvn compile' + } + } + + stage('test') { + steps { + echo 'test maven app' + sh 'mvn clean test' + } + } + + stage('package') { + steps { + echo 'package maven app' + sh 'mvn package -DskipTests' + archiveArtifacts 'target/*.war' + } + } + + } + tools { + maven 'Maven 3.6.3' + } +} \ No newline at end of file diff --git a/README.md b/README.md index 38a78cde..6cbc838e 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -This is a Sample Maven App. +This is a Sample Maven App diff --git a/jenkinsfile b/jenkinsfile new file mode 100644 index 00000000..491866c3 --- /dev/null +++ b/jenkinsfile @@ -0,0 +1,30 @@ +pipeline{ + +agent any + +tools{ +maven 'Maven 3.6.3' +} + +stages{ +stage('build'){ +steps{ +echo 'compile maven app' +sh 'mvn compile' +} +} +stage('test'){ +steps{ +echo 'test maven app' +sh 'mvn clean test' +} +} +stage('package'){ +steps{ +echo 'package maven app' +sh 'mvn package -DskipTests' +} +} +} + +}