From 88fdf994f08d299ca2f2e5d11133b92ebdb3c623 Mon Sep 17 00:00:00 2001 From: "YM-RD-AP01\\ymadmin" Date: Fri, 10 May 2019 18:01:13 +0800 Subject: [PATCH] 20170121: Job [HRB_APP_Commit_Build] configuration updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change performed by §N¨ήS --- jobs/HRB_APP_Commit_Build/config.xml | 90 ++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 26 deletions(-) diff --git a/jobs/HRB_APP_Commit_Build/config.xml b/jobs/HRB_APP_Commit_Build/config.xml index 2a5eb676..01fc7849 100644 --- a/jobs/HRB_APP_Commit_Build/config.xml +++ b/jobs/HRB_APP_Commit_Build/config.xml @@ -43,35 +43,73 @@ Jenkins will send email to RD Team if build fails. false false false - - - - true - true - false - false - false - false - never - true - Jenkins please retry a build - true - true - true - RegexBasedFilter - - - (.*release.*|.*hotfix.*|.*develop|.*master) - - {AQAAABAAAAAQOWG138LyDlzsNOkwf4VcngJKesFwnZvSqzefJtqP9F8=} - - false - - + false - npm run test + #!/bin/groovy +pipeline { + tools { + nodejs 'default-nodejs' + } + stages { + stage('Startup') { + steps { + script { + sh 'npm install' + } + } + } + stage('Test') { + steps { + script { + sh 'npm run test' + } + } + post { + always { + step([$class: 'CoberturaPublisher', coberturaReportFile: 'output/coverage/jest/cobertura-coverage.xml']) + } + } + } + stage('Build') { + steps { + script { + sh 'npm start' + sh 'npm pack' + } + } + } + stage('Deploy') { + when { + expression { + currentBuild.result == null || currentBuild.result == 'SUCCESS' + } + } + steps { + script { + def server = Artifactory.server 'My_Artifactory' + uploadArtifact(server) + } + } + } + } +} +def uploadArtifact(server) { + def uploadSpec = """{ + "files": [ + { + "pattern": "continuous-test-code-coverage-guide*.tgz", + "target": "npm-stable/" + } + ] + }""" + server.upload(uploadSpec) + + def buildInfo = Artifactory.newBuildInfo() + server.upload spec: uploadSpec, buildInfo: buildInfo + server.publishBuildInfo buildInfo +} -- 2.26.2