Files
CraterLib/Jenkinsfile

39 lines
1.4 KiB
Plaintext
Raw Normal View History

2024-06-11 21:38:47 +02:00
pipeline {
2024-06-11 21:40:15 +02:00
agent {
label "master"
}
2024-06-11 21:38:47 +02:00
stages {
stage("Build LTS Folders") {
steps {
script {
def subfolderNames = ["1.18.2", "1.19.2", "1.19.3", "1.20", "1.20.2", "1.20.4"]
boolean hasFailure = false
2024-06-11 21:38:47 +02:00
for (def subfolderName : subfolderNames) {
def subfolderPath = "${WORKSPACE}/${subfolderName}/.jenkins/Jenkinsfile.snapshot"
2024-06-11 21:38:47 +02:00
if (fileExists(subfolderPath)) {
try {
dir("${WORKSPACE}/${subfolderName}") {
def subfolderJob = load ".jenkins/Jenkinsfile.snapshot"
subfolderJob()
}
} catch (Exception e) {
echo "Error running pipeline for ${subfolderPath}: ${e.message}"
hasFailure = true
}
} else {
echo "Skipping non-existent Jenkinsfile: ${subfolderPath}"
}
2024-06-11 21:44:13 +02:00
}
2024-06-11 21:38:47 +02:00
if (hasFailure) {
error "One or more subfolder pipelines failed."
}
}
2024-06-11 21:38:47 +02:00
}
}
}
}