diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..fb4b96a --- /dev/null +++ b/Jenkinsfile @@ -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!' + } + } +}