Ajouter Jenkinsfile
This commit is contained in:
100
Jenkinsfile
vendored
Normal file
100
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
pipeline {
|
||||
agent { label 'windows' }
|
||||
|
||||
options {
|
||||
timestamps()
|
||||
disableConcurrentBuilds()
|
||||
timeout(time: 30, unit: 'MINUTES')
|
||||
}
|
||||
|
||||
triggers {
|
||||
// Poll SCM sans schedule - activé uniquement par webhook
|
||||
pollSCM('')
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
echo 'Checking out code...'
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build Debug') {
|
||||
steps {
|
||||
script {
|
||||
echo 'Building Khaotic Engine Debug...'
|
||||
|
||||
// Trouve le fichier .sln automatiquement
|
||||
def slnFile = bat(
|
||||
script: 'dir /b *.sln',
|
||||
returnStdout: true
|
||||
).trim()
|
||||
|
||||
echo "Building solution: ${slnFile}"
|
||||
|
||||
// Build avec MSBuild
|
||||
bat """
|
||||
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe" ^
|
||||
"${slnFile}" ^
|
||||
/p:Configuration=Debug ^
|
||||
/p:Platform=x64 ^
|
||||
/p:ProductVersion=1.0.${env.BUILD_NUMBER}.0 ^
|
||||
/m ^
|
||||
/verbosity:minimal
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build Release') {
|
||||
steps {
|
||||
script {
|
||||
echo 'Building Khaotic Engine Release...'
|
||||
|
||||
def slnFile = bat(
|
||||
script: 'dir /b *.sln',
|
||||
returnStdout: true
|
||||
).trim()
|
||||
|
||||
bat """
|
||||
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe" ^
|
||||
"${slnFile}" ^
|
||||
/p:Configuration=Release ^
|
||||
/p:Platform=x64 ^
|
||||
/p:ProductVersion=1.0.${env.BUILD_NUMBER}.0 ^
|
||||
/m ^
|
||||
/verbosity:minimal
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Archive Artifacts') {
|
||||
steps {
|
||||
echo 'Archiving build artifacts...'
|
||||
|
||||
// Archive les exécutables et DLL générés
|
||||
archiveArtifacts artifacts: '**/Debug/**/*.exe, **/Release/**/*.exe, **/Debug/**/*.dll, **/Release/**/*.dll',
|
||||
allowEmptyArchive: true,
|
||||
fingerprint: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
echo 'Build completed!'
|
||||
}
|
||||
success {
|
||||
echo 'Build successful! 🎉'
|
||||
}
|
||||
failure {
|
||||
echo 'Build failed! ❌'
|
||||
}
|
||||
cleanup {
|
||||
// Nettoie le workspace mais garde les artifacts
|
||||
cleanWs(deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user