From 30e14542ef408a9d4897e8b04452b0c6d1c58ba7 Mon Sep 17 00:00:00 2001 From: xadocker <1793360097@qq.com> Date: Fri, 9 Dec 2022 17:52:12 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E5=A2=9E=E5=8A=A0Jenkinsfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/hello/Jenkinsfile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/main/java/hello/Jenkinsfile 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' + } + } + } + } +} +