diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..16f0de56 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,57 @@ +pipeline { + agent { + docker { + image 'maven:3.6.3-jdk-11-slim' + } + + } + stages { + stage('build') { + steps { + echo 'Compiling the code for sysfoo app' + sh 'mvn compile' + } + } + + stage('Test') { + steps { + echo 'Clean test with unit test for sysfoo' + sh 'mvn clean test' + } + } + + stage('Package') { + parallel { + stage('Package') { + when { + branch 'master' + } + steps { + echo 'Generating artifacts for deployment' + sh 'mvn package -DskipTests' + } + } + + stage('TestA') { + steps { + sleep(time: 5, unit: 'SECONDS') + } + } + + } + } + + stage('TestB') { + steps { + sleep 3 + } + } + + } + post { + always { + echo 'This pipeline is completed..' + } + + } +} \ No newline at end of file diff --git a/README.md b/README.md index 38a78cde..098b6ee6 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ This is a Sample Maven App. +Trying to push with branch rules