Jenkins Test #14
This commit is contained in:
15
Jenkinsfile
vendored
15
Jenkinsfile
vendored
@@ -89,20 +89,22 @@ pipeline {
|
|||||||
post {
|
post {
|
||||||
success {
|
success {
|
||||||
script {
|
script {
|
||||||
// Construit une liste de chaînes JSON manuellement
|
// Prépare la liste d'URL brutes
|
||||||
def urlsList = []
|
def urlsList = []
|
||||||
if (params.BUILD_TYPE in ['Both','Debug']) {
|
if (params.BUILD_TYPE in ['Both','Debug']) {
|
||||||
urlsList << "\"${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Debug.zip\""
|
urlsList << "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Debug.zip"
|
||||||
}
|
}
|
||||||
if (params.BUILD_TYPE in ['Both','Release']) {
|
if (params.BUILD_TYPE in ['Both','Release']) {
|
||||||
urlsList << "\"${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Release.zip\""
|
urlsList << "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Release.zip"
|
||||||
}
|
}
|
||||||
def urlsJson = "[${urlsList.join(',')}]"
|
// Fabrication manuelle d'un JSON array de strings
|
||||||
|
def urlsJson = urlsList.collect { "\"${it}\"" }.join(',' )
|
||||||
|
urlsJson = "[${urlsJson}]"
|
||||||
|
|
||||||
bat """
|
bat """
|
||||||
curl -X POST http://192.168.1.131:2500/ci-notify ^
|
curl -X POST http://192.168.1.131:2500/ci-notify ^
|
||||||
-H "Content-Type: application/json" ^
|
-H "Content-Type: application/json" ^
|
||||||
-d "{\\"userId\\": \\"${params.DISCORD_USER_ID}\\",\\"status\\": \\"success\\",\\"urls\\":${urlsJson}}"
|
-d "{\\"userId\\":\\"${params.DISCORD_USER_ID}\\",\\"status\\":\\"success\\",\\"urls\\":${urlsJson}}"
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,10 +113,9 @@ pipeline {
|
|||||||
bat """
|
bat """
|
||||||
curl -X POST http://192.168.1.131:2500/ci-notify ^
|
curl -X POST http://192.168.1.131:2500/ci-notify ^
|
||||||
-H "Content-Type: application/json" ^
|
-H "Content-Type: application/json" ^
|
||||||
-d "{\\"userId\\": \\"${params.DISCORD_USER_ID}\\",\\"status\\": \\"failure\\",\\"urls\\":[]}"
|
-d "{\\"userId\\":\\"${params.DISCORD_USER_ID}\\",\\"status\\":\\"failure\\",\\"urls\\":[]}"
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user