From ad58b0b0f65e99dacdb3c754352bd1def7b51596 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 21 Jul 2020 09:52:25 +0800 Subject: 更新 Jenkinsfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 53 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 51c2695e..7176cc39 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,22 +1,31 @@ -pipeline { - agent any - stages { - stage("检出") { - steps { - checkout([ - $class: 'GitSCM', - branches: [[name: env.GIT_BUILD_REF]], - userRemoteConfigs: [[ - url: env.GIT_REPO_URL, - credentialsId: env.CREDENTIALS_ID - ]]]) - } - } - stage('自定义构建过程') { - steps { - echo "自定义构建过程开始" - // 请在此处补充您的构建过程 - } - } - } -} +pipeline { + agent { + docker { + image 'mcr.microsoft.com/dotnet/core/sdk' + reuseNode true + } + + } + stages { + stage('检出') { + steps { + checkout([ + $class: 'GitSCM', + branches: [[name: env.GIT_BUILD_REF]], + userRemoteConfigs: [[ + url: env.GIT_REPO_URL, + credentialsId: env.CREDENTIALS_ID + ]]]) + } + } + stage('构建与测试') { + steps { + sh 'dotnet test --logger html --collect:"XPlat Code Coverage" --settings \'./Timeline.Tests/coverletArgs.runsettings\'' + codingHtmlReport(name: 'test-result', path: 'Timeline.Tests/TestResults/', entryFile: 'index.html') + } + } + } + environment { + ASPNETCORE_ENVIRONMENT = 'Development' + } + } \ No newline at end of file -- cgit v1.2.3