diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..1d63bcc --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,46 @@ +#!/usr/bin/env groovy + +try { + echo 'Trying to load shared libraries...' + library identifier: "libInit@${params.libBranch}", retriever: modernSCM( + [$class: 'GitSCMSource', + remote: '', + credentialsId: null] + ) + echo 'Shared library loaded' +} catch (error) { + echo "Could not load shared libraries: ${error.message}" + exit(1) +} + +// PIPELINE + +try { + stage('Static code validation') { + if (config.compile) { + label('docker') { + echo 'Validation goes here' + } + } else { + echo 'Not validating' + } + } + stage('Test') { + if (config.test) { + label('docker') { + echo 'Testing goes here...' + } + } else { + echo 'Not testing' + } + } + currentBuild.result = 'SUCCESS' +} catch (Exception error) { + currentBuild.result = 'FAILURE' +} finally { + stage('Build result notification') { + if (config.notify) { + echo 'Notification goes here' + } + } +}