Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
pipeline {
agent any
tools {
// Specify the Gradle version configured in Jenkins
gradle 'Gradle'
// Specify the JDK version configured in Jenkins
jdk 'Java 21'
}
stages {
stage('Checkout') {
steps {
// Checkout code from SCM (e.g., Git)
checkout scm
}
}
stage('Build') {
steps {
// Run Gradle build
sh './gradlew clean build'
}
}
stage('Publish Artifacts') {
when {
// Only publish for main branch
branch 'main'
}
steps {
// Archive build artifacts
archiveArtifacts artifacts: 'build/libs/*.jar', allowEmptyArchive: true
}
}
}
post {
always {
// Clean workspace after build
cleanWs()
}
success {
// Notify on success
echo 'Build and tests completed successfully!'
}
failure {
// Notify on failure
echo 'Build or tests failed!'
}
}
}