The pipeline: Jenkinsfile
The minimal content for the Jenkinsfile
is as follows:
@Library(['github.com/indigo-dc/jenkins-pipeline-library@stable/2.0.0']) _
def projectConfig
pipeline {
agent any
stages {
stage('SQA baseline dynamic stages') {
steps {
script {
projectConfig = pipelineConfig()
buildStages(projectConfig)
}
}
post {
cleanup {
cleanWs()
}
}
}
}
}
The pipeline explained
The pipeline loads the jenkins-pipeline-library in the first place:
@Library(['github.com/indigo-dc/jenkins-pipeline-library@stable/2.0.0']) _
and only requires the definition of a single stage that will be in charge of:
Parsing the
.sqa/config.yml
file:
projectConfig = pipelineConfig()
Build one stage per criteria found in
sqa_criteria
setting in the.sqa/config.yml
file:
buildStages(projectConfig)
Note
The library expects by default the presence of the configuration file in
.sqa/config.yml
. This behaviour can be changed by passing the path of
the file using the configFile
optional argument:
projectConfig = pipelineConfig(configFile=<alternative_path>)