freeleaps-ops/first-class-pipeline/vars/pipelineCall.groovy
孙振宇 ed959561db chore(git): codes staging
Signed-off-by: 孙振宇 <>
2025-01-17 16:25:04 +08:00

51 lines
1.0 KiB
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')
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")
}
}
}
}
}
}
}