diff --git a/src/main/java/hello/Jenkinsfile b/src/main/java/hello/Jenkinsfile new file mode 100644 index 0000000..f61f54d --- /dev/null +++ b/src/main/java/hello/Jenkinsfile @@ -0,0 +1,30 @@ +pipeline { + agent any + + tools { + // Install the Maven version configured as "M3" and add it to the path. + maven "maven" + } + + stages { + stage('Get code') { + steps { + git url: 'https://gitea.xadocker.cn/resource/springboot-demo.git', branch: 'main', credentialsId: '867be6fa-88b1-4715-bcd6-3b2ebe671138' + } + } + stage("Build") { + steps { + sh "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' + } + } + } + } +} +