diff --git a/Jenkinsfile b/Jenkinsfile index c2b4256..4596ee8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,6 +6,7 @@ credentialsId: null, ] +// Load libraries try { echo 'Trying to load shared libraries...' library identifier: "libInit@${libInit.branch}", retriever: modernSCM( @@ -19,41 +20,22 @@ exit(1) } -// Configuration +// Initialize configuration def config = initPipeline() -if (config == null) { +if (!config) { + // Fail config is empty currentBuild.result = 'FAILURE' return } -// PIPELINE +// CI Pipeline +stageCompile() +stageTest() +stagePackage() -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' - } - } -} +// CD Pipeline +if (config.extended) { + stageRelease() + stageDelivery() + stageNotify() +} \ No newline at end of file