Jenkins Test #12
This commit is contained in:
59
Jenkinsfile
vendored
59
Jenkinsfile
vendored
@@ -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\\":[]}"
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user