-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewer_data_management_BL_service.groovy
29 lines (29 loc) · 1.98 KB
/
viewer_data_management_BL_service.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
node('master') {
try {
stage('Checkout') {
cleanWs()
checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[cancelProcessOnExternalsFail: true, credentialsId: '585fa701-720a-4602-abe6-b977c8773a4c', depthOption: 'infinity', ignoreExternalsOption: true, local: '.', remote: 'https://192.168.1.200/svn/api/Products/Cloud BLM/Application/branches/Experimental branch/BackEnd Services- Unified Database/CloudBLM-ViewerDataService/ViewerData-BusinessLogic']], quietOperation: true, workspaceUpdater: [$class: 'UpdateUpdater']])
}
stage('NPM Install') {
sh 'npm install'
}
stage('Build') {
sh 'npm run prod'
}
stage('Publish') {
sh label: 'Copy dist/server.js', script: 'sudo cp -v ${WORKSPACE}/dist/server.js /opt/apps/ViewerDataService/BusinessLogic/server.js'
sh label: 'Copy Node Modules', script: 'sudo cp -R ${WORKSPACE}/node_modules /opt/apps/ViewerDataService/BusinessLogic'
sh label: 'Copy server.config.js', script: 'sudo cp -v ${WORKSPACE}/server.config.js /opt/apps/ViewerDataService/BusinessLogic/server.config.js'
//sh label: 'Copy appversion.json', script: 'sudo cp -v ${WORKSPACE}/appversion.json /opt/apps/ViewerDataService/BusinessLogic/appversion.json'
deleteDir()
}
currentBuild.result = 'SUCCESS'
} catch (Exception err) {
currentBuild.result = 'FAILURE'
}
stage('Notify') {
if(currentBuild.result == 'FAILURE') {
mail bcc: '', body: "Hi,\n Jenkins have some issues in ${JOB_NAME} build #${BUILD_NUMBER} \n\n Build URL = ${BUILD_URL} \n\n Job URL = ${JOB_URL}", cc: '', from: '[email protected]', replyTo: '', subject: "Problem in ${JOB_NAME} build #${BUILD_NUMBER}", to: '[email protected]'
}
}
}