first_admin
b74b63fdb5
Some checks failed
jenkins_organization/maven_project/pipeline/head There was a failure building this commit
38 lines
824 B
Groovy
38 lines
824 B
Groovy
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!'
|
|
}
|
|
}
|
|
}
|