Jenkinsfile
Some checks failed
jenkins_organization/maven_project/pipeline/head There was a failure building this commit
Some checks failed
jenkins_organization/maven_project/pipeline/head There was a failure building this commit
This commit is contained in:
parent
0b570e8074
commit
3f9521ba0e
37
Jenkinsfile
vendored
Normal file
37
Jenkinsfile
vendored
Normal 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!'
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user