Skip to content

Commit d011d18

Browse files
author
Matt
committed
fix: jenkins
1 parent f533ed3 commit d011d18

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Jenkinsfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
pipeline {
2+
agent any
3+
tools {
4+
// Specify the Gradle version configured in Jenkins
5+
gradle 'Gradle'
6+
// Specify the JDK version configured in Jenkins
7+
jdk 'Java 21'
8+
}
9+
stages {
10+
stage('Checkout') {
11+
steps {
12+
// Checkout code from SCM (e.g., Git)
13+
checkout scm
14+
}
15+
}
16+
stage('Build') {
17+
steps {
18+
// Run Gradle build
19+
sh './gradlew clean build'
20+
}
21+
}
22+
stage('Publish Artifacts') {
23+
when {
24+
// Only publish for main branch
25+
branch 'main'
26+
}
27+
steps {
28+
// Archive build artifacts
29+
archiveArtifacts artifacts: 'build/libs/*.jar', allowEmptyArchive: true
30+
}
31+
}
32+
}
33+
post {
34+
always {
35+
// Clean workspace after build
36+
cleanWs()
37+
}
38+
success {
39+
// Notify on success
40+
echo 'Build and tests completed successfully!'
41+
}
42+
failure {
43+
// Notify on failure
44+
echo 'Build or tests failed!'
45+
}
46+
}
47+
}

0 commit comments

Comments
 (0)