freeleaps-ops/first-class-pipeline/vars/pipelineCall.groovy
2025-01-20 10:48:52 +08:00

49 lines
1020 B
Groovy

#!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')
}
stages {
stage("Source Codes Checkout") {
steps {
script {
def sourceFetcher = new SourceFetcher(this)
sourceFetcher.fetch(configurations)
}
}
}
stage("Prepared Environment Variables") {
steps {
script {
environmentVars.injectVars(configurations)
}
}
}
stage("Commit Linting If Enabled") {
steps {
script {
def enabled = "${configurations.COMMIT_MESSAGE_LINT_ENABLED}"
if (enabled == "true") {
print("Commit Linting is enabled")
}
}
}
}
}
}
}