diff --git a/README.md b/README.md index b8ad8a94af..295f36f7ed 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,14 @@ Architecture * A Postgres database backed by a Docker volume * A Node.js webapp which shows the results of the voting in real time - Note ---- The voting application only accepts one vote per client. It does not register votes if a vote has already been submitted from a client. +### 2022-12-04 ### 20:01 +subject=Unittest +[![Build Status](http://5.61.27.73:8080/buildStatus/icon?job=instavote%2Fworker-build)](http://5.61.27.73:8080/job/instavote/job/worker-build/) + +[![Build Status](http://5.61.27.73:8080/buildStatus/icon?job=instavote%2Fworker-test)](http://5.61.27.73:8080/job/instavote/job/worker-test/) + +### 2022-12-05 ### 17:50 diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile new file mode 100644 index 0000000000..0091427d6b --- /dev/null +++ b/worker/Jenkinsfile @@ -0,0 +1,50 @@ +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 Tets 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' + } + } + } + } + post{ + always{ + archiveArtifacts artifacts: '**/target/*.jar', + fingerprint: true + echo 'Building multibranch pipeline for worker is completed..' + } + } +}