freeleaps-ops/first-class-pipeline/vars/pipelineCall.groovy

51 lines
1.0 KiB
Groovy
Raw Normal View History

#!groovy
import com.freeleaps.devops.EnvironmentVars
import com.freeleaps.devops.SourceFetcher
def call(Map configurations) {
def environmentVars = new EnvironmentVars(this)
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '25'))
timeout(time: 30, unit: 'MINUTES')
ansiColor('xterm')
timestamps()
}
stages {
stage("Source Codes Checkout") {
steps {
scripts {
var sourceFetcher = new SourceFetcher(this)
sourceFetcher.fetch(configurations)
}
}
}
stage("Prepared Environment Variables") {
steps {
script {
environmentVars.injectVars(configurations)
}
}
}
stage("Commit Linting If Enabled") {
steps {
scripts {
enabled = "${configurations.COMMIT_MESSAGE_LINT_ENABLED}"
if (enabled == "true") {
print("Commit Linting is enabled")
}
}
}
}
}
}
}