Jenkins Test #12

This commit is contained in:
2025-10-08 18:10:28 +02:00
parent 2f5a970a4e
commit 14c07f8750

59
Jenkinsfile vendored
View File

@@ -87,33 +87,34 @@ pipeline {
} }
post { post {
success { success {
script { script {
def urls = [] // Construit une liste de chaînes JSON manuellement
if (params.BUILD_TYPE in ['Both','Debug']) { def urlsList = []
urls << "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Debug.zip" if (params.BUILD_TYPE in ['Both','Debug']) {
} urlsList << "\"${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Debug.zip\""
if (params.BUILD_TYPE in ['Both','Release']) {
urls << "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Release.zip" if (params.BUILD_TYPE in ['Both','Release']) {
} urlsList << "\"${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Release.zip\""
bat """ }
curl -X POST http://192.168.1.131:2500/ci-notify ^ def urlsJson = "[${urlsList.join(',')}]"
-H "Content-Type: application/json" ^
-d "{\\"userId\\": \\"${params.DISCORD_USER_ID}\\",\\"status\\": \\"success\\",\\"urls\\":${groovy.json.JsonOutput.toJson(urls)}}" 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 ^ failure {
-H "Content-Type: application/json" ^ script {
-d "{\\"userId\\": \\"${params.DISCORD_USER_ID}\\",\\"status\\": \\"failure\\",\\"urls\\":[]}" 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) }
} }
} }
} }