Jenkinsfile
Some checks failed
jenkins_organization/maven_project/pipeline/head There was a failure building this commit

This commit is contained in:
Patryk 2024-08-29 19:55:24 +02:00
parent 0b570e8074
commit 3f9521ba0e

37
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,37 @@
pipeline {
agent {
label 'agent1'
}
stages {
stage('Build') {
steps {
// Kompilowanie i pakowanie aplikacji za pomocą Mavena
script {
sh 'mvn clean package'
}
}
}
stage('Test') {
steps {
// Uruchomienie testów jednostkowych
script {
sh 'mvn test'
}
}
}
}
post {
success {
// Archiwizacja artefaktów po udanym budowaniu
archiveArtifacts artifacts: 'target/*.jar', allowEmptyArchive: true
}
failure {
// Powiadomienie o nieudanym budowaniu
echo 'Build failed!'
}
}
}