Jenkins Test #5

This commit is contained in:
2025-10-08 17:11:48 +02:00
parent f1db564fb3
commit 90a43254f3

59
Jenkinsfile vendored
View File

@@ -20,15 +20,55 @@ pipeline {
stage('Build') { stage('Build') {
parallel { parallel {
stage('Build Debug') { /* … */ } stage('Build Debug') {
stage('Build Release') { /* … */ } steps {
echo 'Building Debug...'
bat """
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe" ^
"%WORKSPACE%\\KhaoticEngineReborn.sln" ^
/p:Configuration=Debug ^
/p:Platform=x64 ^
/m ^
/verbosity:minimal
"""
}
}
stage('Build Release') {
steps {
echo 'Building Release...'
bat """
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe" ^
"%WORKSPACE%\\KhaoticEngineReborn.sln" ^
/p:Configuration=Release ^
/p:Platform=x64 ^
/m ^
/verbosity:minimal
"""
}
}
} }
} }
stage('Package') { stage('Package') {
parallel { parallel {
stage('Package Debug') { /* … */ } stage('Package Debug') {
stage('Package Release') { /* … */ } steps {
echo 'Packaging Debug into ZIP'
bat 'if not exist "%WORKSPACE%\\builds" mkdir "%WORKSPACE%\\builds"'
bat """
powershell -Command "Compress-Archive -Path '%WORKSPACE%\\**\\Debug\\*' -DestinationPath '%WORKSPACE%\\builds\\KhaoticEngineReborn_Debug.zip' -Force"
"""
}
}
stage('Package Release') {
steps {
echo 'Packaging Release into ZIP'
bat 'if not exist "%WORKSPACE%\\builds" mkdir "%WORKSPACE%\\builds"'
bat """
powershell -Command "Compress-Archive -Path '%WORKSPACE%\\**\\Release\\*' -DestinationPath '%WORKSPACE%\\builds\\KhaoticEngineReborn_Release.zip' -Force"
"""
}
}
} }
} }
@@ -42,16 +82,13 @@ pipeline {
post { post {
success { success {
script { script {
// Construis la liste des URLs d'artefacts
def debugUrl = "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Debug.zip" def debugUrl = "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Debug.zip"
def releaseUrl = "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Release.zip" def releaseUrl = "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Release.zip"
// Appelle l'endpoint de ton bot pour envoyer le DM
sh """ sh """
curl -X POST http://localhost:2500/ci-notify \ curl -X POST http://localhost:3000/ci-notify \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d '{ -d '{
"userId": "TON_USER_ID_DISCORD", "userId": "VOTRE_USER_ID_DISCORD",
"status": "success", "status": "success",
"urls": ["${debugUrl}", "${releaseUrl}"] "urls": ["${debugUrl}", "${releaseUrl}"]
}' }'
@@ -61,10 +98,10 @@ pipeline {
failure { failure {
script { script {
sh """ sh """
curl -X POST http://localhost:2500/ci-notify \ curl -X POST http://localhost:3000/ci-notify \
-H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \
-d '{ -d '{
"userId": "TON_USER_ID_DISCORD", "userId": "VOTRE_USER_ID_DISCORD",
"status": "failure", "status": "failure",
"urls": [] "urls": []
}' }'