diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..daa8063f --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,30 @@ +pipeline { + agent any + + stages{ + stage("one"){ + steps{ + echo 'step 1' + sleep 3 + } + } + stage("two"){ + steps{ + echo 'step 2' + sleep 9 + } + } + stage("three"){ + steps{ + echo 'step 3' + sleep 5 + } + } + } + + post{ + always{ + echo 'This pipeline is completed.' + } + } +} diff --git a/README.md b/README.md index b8ad8a94..9174c50d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ Example Voting App -========= +========== Getting started --------------- diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile new file mode 100644 index 00000000..202f4ad3 --- /dev/null +++ b/worker/Jenkinsfile @@ -0,0 +1,49 @@ +pipeline { + agent any + tools{ + maven 'maven 3.6.1' + } + stages{ + stage("build"){ + when{ + changeset "**/worker/**" + } + steps{ + echo 'Compiling worker app..' + dir('worker'){ + sh 'mvn compile' + } + } + } + stage("test"){ + when{ + changeset "**/worker/**" + } + steps{ + echo 'Running Unit Tests on worker app..' + dir('worker'){ + sh 'mvn clean test' + } + } + } + stage("package"){ + when{ + branch 'master' + changeset "**/worker/**" + } + steps{ + echo 'Packaging worker app' + dir('worker'){ + sh 'mvn package -DskipTests' + archiveArtifacts artifacts: '**/target/*.jar', + fingerprint:true + } + } + } + } + post{ + always{ + echo 'Building multibranch pipeline for worker is completed..' + } + } + } \ No newline at end of file