diff --git a/README.md b/README.md index b8ad8a94..48c46be0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ Example Voting App ========= +Hello +This is a sample voting app. +filename: README.MD Getting started --------------- diff --git a/bla.txt b/bla.txt new file mode 100644 index 00000000..e69de29b diff --git a/result/Jenkinsfile b/result/Jenkinsfile new file mode 100644 index 00000000..6eea9d19 --- /dev/null +++ b/result/Jenkinsfile @@ -0,0 +1,31 @@ +pipeline { +agent any +tools{ +nodejs 'NodeJS 19.0.1' +} +stages{ +stage(build){ +when{ +changeset "**/result/**" +} +steps{ +echo 'Compiling result app..' +dir('worker'){ +sh 'npm install' +} +} +} +stage(test){ +when{ +changeset "**/result/**" +} +steps{ +echo 'Running Unit Tests on result app..' +dir('result'){ +sh 'npm install' +sh 'npm test' +} +} +} +} +} diff --git a/result/test/mock.test.js b/result/test/mock.test.js index f99dfdae..bdcd486e 100644 --- a/result/test/mock.test.js +++ b/result/test/mock.test.js @@ -26,4 +26,10 @@ describe('mock test 4', () => { }); }); +describe('mock test 5', () => { + it('unit test 5', () => { + expect(true).to.be.true; + }); +}); + diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile new file mode 100644 index 00000000..e66f4695 --- /dev/null +++ b/worker/Jenkinsfile @@ -0,0 +1,48 @@ +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' +archiveArtifacts artifacts: '**/target/*.jar', +fingerprint: true } +} +} +} +post{ +always{ +echo 'Building multibranch pipeline for worker is completed..' +} +} +}