Skip to content

Commit

Permalink
Add Jenkins CI CD script
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelodebittencourt committed Oct 7, 2021
1 parent a96db01 commit bacd243
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
32 changes: 32 additions & 0 deletions pipeline_as_code/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
pipeline {
agent any

tools {
// Install the Maven version configured as "M3" and add it to the path.
maven "M3"
}

stages {
stage('Build') {
steps {
// Get some code from a GitHub repository
git 'https://github.com/marcelodebittencourt/Java_JUnit5_Unit_Test_handsOn_ViradaDaQualidade.git'

// Run Maven on a Unix agent.
//sh "mvn -Dmaven.test.failure.ignore=true clean package"

// To run Maven on a Windows agent, use
bat "mvn -Dmaven.test.failure.ignore=true clean package"
}

post {
// If Maven was able to run the tests, even if some of the test
// failed, record the test results and archive the jar file.
success {
junit '**/target/surefire-reports/TEST-*.xml'
archiveArtifacts 'target/*.jar'
}
}
}
}
}
6 changes: 5 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,8 @@ Este código foi gerado ao longo do hands-on que foi realizado ao vivo no evento
7. No menu de contexto que aparece selecione "Open In" > "Browser" > "Chrome".

## Contato do autor
https://marcelodebittencourt.com
https://marcelodebittencourt.com

## CI/CD suportados:
* [GitHub Action](https://github.com/marcelodebittencourt/Java_JUnit5_Unit_Test_handsOn_ViradaDaQualidade/blob/master/.github/workflows/test.yml): quando um push é realizado neste repositório do GitHub, os testes são automaticamente executados.
* [Jenkins](https://github.com/marcelodebittencourt/Java_JUnit5_Unit_Test_handsOn_ViradaDaQualidade/blob/master/pipeline_as_code/Jenkinsfile): previamente configure na instância do Jenkins o apontamento para o Java JDK 11 e para o Maven coloque o nome de "M3".

0 comments on commit bacd243

Please sign in to comment.