From 92c315312489518f9b708eb4c0992f132df47a8d Mon Sep 17 00:00:00 2001 From: hypherionmc Date: Tue, 11 Jun 2024 21:38:47 +0200 Subject: [PATCH] [DEV] Add pipeline script --- Jenkinsfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..4719947 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,32 @@ +pipeline { + 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 + + for (def subfolderName in subfolderNames) { + def subfolderPath = "${WORKSPACE}/${subfolderName}" + + if (dir(subfolderPath).exists()) { + try { + def subfolderJob = load "${subfolderPath}/.jenkins/Jenkinsfile.snapshot" + subfolderJob() + } catch (Exception e) { + echo "Error running pipeline for ${subfolderPath}: ${e.message}" + hasFailure = true + } + } else { + echo "Skipping non-existent folder: ${subfolderPath}" + } + } + + if (hasFailure) { + error "One or more subfolder pipelines failed." + } + } + } + } + } +} \ No newline at end of file