From 14c07f8750d714873474904b4f5bdc6aecd46026 Mon Sep 17 00:00:00 2001 From: CatChow0 Date: Wed, 8 Oct 2025 18:10:28 +0200 Subject: [PATCH] Jenkins Test #12 --- Jenkinsfile | 59 +++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b39be6a..86a8f2e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -87,33 +87,34 @@ pipeline { } post { - success { - script { - def urls = [] - if (params.BUILD_TYPE in ['Both','Debug']) { - urls << "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Debug.zip" - } - if (params.BUILD_TYPE in ['Both','Release']) { - urls << "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Release.zip" - } - bat """ - curl -X POST http://192.168.1.131:2500/ci-notify ^ - -H "Content-Type: application/json" ^ - -d "{\\"userId\\": \\"${params.DISCORD_USER_ID}\\",\\"status\\": \\"success\\",\\"urls\\":${groovy.json.JsonOutput.toJson(urls)}}" - """ - } - } - failure { - script { - bat """ - curl -X POST http://192.168.1.131:2500/ci-notify ^ - -H "Content-Type: application/json" ^ - -d "{\\"userId\\": \\"${params.DISCORD_USER_ID}\\",\\"status\\": \\"failure\\",\\"urls\\":[]}" - """ - } - } - always { - cleanWs(deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true) - } - } + success { + script { + // Construit une liste de chaƮnes JSON manuellement + def urlsList = [] + if (params.BUILD_TYPE in ['Both','Debug']) { + urlsList << "\"${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Debug.zip\"" + + if (params.BUILD_TYPE in ['Both','Release']) { + urlsList << "\"${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Release.zip\"" + } + def urlsJson = "[${urlsList.join(',')}]" + + bat """ + curl -X POST http://192.168.1.131:2500/ci-notify ^ + -H "Content-Type: application/json" ^ + -d "{\\"userId\\": \\"${params.DISCORD_USER_ID}\\",\\"status\\": \\"success\\",\\"urls\\":${urlsJson}}" + """ + } + } + failure { + script { + bat """ + curl -X POST http://192.168.1.131:2500/ci-notify ^ + -H "Content-Type: application/json" ^ + -d "{\\"userId\\": \\"${params.DISCORD_USER_ID}\\",\\"status\\": \\"failure\\",\\"urls\\":[]}" + """ + } + } + } + }