diff --git a/Jenkinsfile b/Jenkinsfile index 248b92a..b15c6c5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,33 +1,69 @@ pipeline { - agent any + agent none stages { - stage('Build') { + stage('Build') { + parallel { + stage('Linux Build') { + agent { docker 'linux-build-agent:latest' } steps { echo 'Building..' - sh './build.sh' - archiveArtifacts artifacts: 'build/hello*', fingerprint: true + sh 'make build/hello-linux-64' + archiveArtifacts artifacts: 'build/hello-linux-64', fingerprint: true } - } - stage('Test') { + } + stage('Windows Build') { + agent { docker 'windows-build-agent:latest' } steps { - echo 'Testing..' - sh 'make test || true' - junit 'build/*.xml' + // echo 'Preparing..' + // cleanWs() + echo 'Building..' + sh 'make build/hello-win64.exe' + archiveArtifacts artifacts: 'build/hello-win64.exe', fingerprint: true + // echo 'Cleaning..' + // cleanWs cleanWhenFailure: false, cleanWhenNotBuilt: false, cleanWhenUnstable: false } - } - stage('Deploy') { - when { - expression { - currentBuild.result == null || currentBuild.result == 'SUCCESS' - } - } + } + stage('MacOSX Build') { + agent { docker 'macosx-build-agent:latest' } steps { - echo 'Deploying....' - sh 'make publish' + echo 'Building..' + sh 'make build/hello-macosx.bin' + archiveArtifacts artifacts: 'build/hello-macosx.bin', fingerprint: true } + } + stage('Linting') { + agent { docker 'lint-agent:latest' } + steps { + echo 'Linting..' + sh 'make tidy || true' + // junit allowEmptyResults: true, healthScaleFactor: 0.0, testResults: 'build/tidy.xml' + sh 'true' + } + } } + } + stage('Test') { + agent { docker 'linux-build-agent:latest' } + steps { + echo 'Testing..' + sh 'make test || true' + junit allowEmptyResults: true, healthScaleFactor: 0.0, testResults: 'build/tests.xml' + } + } + stage('Deploy') { + agent { docker 'linux-build-agent:latest' } + when { + expression { + currentBuild.result == null || currentBuild.result == 'SUCCESS' + } + } + steps { + echo 'Deploying....' + sh 'make publish' + } + } } }