diff --git a/Jenkinsfile b/Jenkinsfile index 0e8a707..5f604a9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -89,37 +89,34 @@ pipeline { } post { - success { - script { - 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" - } + success { + script { + 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" + } + // Convertir en une chaƮne JSON valide d'URLs + def urlsJson = urlsList.collect { "\"${it}\"" }.join(',') + urlsJson = "[${urlsJson}]" - def urlsJson = urlsList.collect { "\"${it}\"" }.join(',') - urlsJson = "[${urlsJson}]" - - 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\\":[]}" - """ - } - } - always { - cleanWs(deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true) - } - } -} + 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\\":[]}" + """ + } + } + } +} \ No newline at end of file