Jenkins Test #4

This commit is contained in:
2025-10-08 17:09:23 +02:00
parent 97b5483cc9
commit f1db564fb3

84
Jenkinsfile vendored
View File

@@ -14,84 +14,64 @@ pipeline {
stages { stages {
stage('Checkout') { stage('Checkout') {
steps { steps {
echo 'Checking out code...'
checkout scm checkout scm
} }
} }
stage('Build') { stage('Build') {
parallel { parallel {
stage('Build Debug') { stage('Build Debug') { /* … */ }
steps { stage('Build Release') { /* … */ }
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') { /* … */ }
steps { stage('Package Release') { /* … */ }
echo 'Packaging Debug build 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 build 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"
"""
}
}
} }
} }
stage('Archive Artifacts') { stage('Archive Artifacts') {
steps { steps {
echo 'Archiving ZIP packages'
archiveArtifacts artifacts: 'builds/*.zip', fingerprint: true archiveArtifacts artifacts: 'builds/*.zip', fingerprint: true
} }
} }
} }
post { post {
always {
echo 'Build completed!'
}
success { success {
echo 'Build successful! 🎉' script {
// Construis la liste des URLs d'artefacts
def debugUrl = "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Debug.zip"
def releaseUrl = "${env.BUILD_URL}artifact/builds/KhaoticEngineReborn_Release.zip"
// Appelle l'endpoint de ton bot pour envoyer le DM
sh """
curl -X POST http://localhost:2500/ci-notify \
-H 'Content-Type: application/json' \
-d '{
"userId": "TON_USER_ID_DISCORD",
"status": "success",
"urls": ["${debugUrl}", "${releaseUrl}"]
}'
"""
}
} }
failure { failure {
echo 'Build failed! ❌' script {
sh """
curl -X POST http://localhost:2500/ci-notify \
-H 'Content-Type: application/json' \
-d '{
"userId": "TON_USER_ID_DISCORD",
"status": "failure",
"urls": []
}'
"""
}
} }
cleanup { always {
cleanWs(deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true) cleanWs(deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true)
} }
} }