diff --git a/result/Jenkinsfile b/result/Jenkinsfile new file mode 100644 index 0000000000..e8e11d50fa --- /dev/null +++ b/result/Jenkinsfile @@ -0,0 +1,46 @@ +pipeline { + agent { + docker { + image 'node:8.16.0-alpine' + } + } + + stages { + stage('build'){ + when { + changeset "**/result/**" + } + steps{ + echo 'Compiling result app' + dir('result'){ + sh 'npm install' + } + } + } + stage('test'){ + when { + changeset "**/result/**" + } + steps{ + echo 'Running Unit Tests on result app' + dir('result'){ + sh 'npm test' + } + } + } + + } + post { + always{ + echo 'Pipeline for result is complete...' + slackSend (channel: 'testing-jenkins-integration', message: "Building... - ${env.JOB_NAME}") + } + failure{ + echo 'Something bad happened...' + slackSend (channel: 'testing-jenkins-integration', message: 'Build Failed - ${env.JOB_NAME}') + } + success{ + slackSend (channel: 'testing-jenkins-integration', message: "Build Succeeded! - ${env.JOB_NAME}") + } + } +} diff --git a/vote/Jenkinsfile b/vote/Jenkinsfile new file mode 100644 index 0000000000..df01471f96 --- /dev/null +++ b/vote/Jenkinsfile @@ -0,0 +1,47 @@ +pipeline { + agent { + docker { + image 'python:2.7.16-slim' + args '--user root' + } + } + + stages { + stage('build'){ + when { + changeset "**/vote/**" + } + steps{ + echo 'Compiling vote app' + dir('vote'){ + sh 'pip install -r requirements.txt' + } + } + } + stage('test'){ + when { + changeset "**/vote/**" + } + steps{ + echo 'Running Unit Tests on vote app' + dir('vote'){ + sh 'nosetests -v' + } + } + } + + } + post { + always{ + echo 'Pipeline for worker is complete...' + slackSend (channel: 'testing-jenkins-integration', message: "Building... - ${env.JOB_NAME}") + } + failure{ + echo 'Something bad happened...' + slackSend (channel: 'testing-jenkins-integration', message: 'Build Failed - ${env.JOB_NAME}') + } + success{ + slackSend (channel: 'testing-jenkins-integration', message: "Build Succeeded! - ${env.JOB_NAME}") + } + } +} diff --git a/worker/Jenkinsfile b/worker/Jenkinsfile new file mode 100644 index 0000000000..2573d0f6e2 --- /dev/null +++ b/worker/Jenkinsfile @@ -0,0 +1,59 @@ +pipeline { + agent { + docker { + image 'maven:3.6.1-jdk-8-alpine' + args '-v $HOME/.m2/root/.m2' + } + } + + 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 'Running Packaging on worker app' + dir('worker'){ + sh 'mvn package -DskipTests' + archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true + } + } + } + } + post { + always{ + echo 'Pipeline for worker is complete...' + slackSend (channel: 'testing-jenkins-integration', message: "Building... - ${env.JOB_NAME}") + } + failure{ + echo 'Something bad happened...' + slackSend (channel: 'testing-jenkins-integration', message: 'Build Failed - ${env.JOB_NAME}') + } + success{ + slackSend (channel: 'testing-jenkins-integration', message: "Build Succeeded! - ${env.JOB_NAME}") + } + } +}