FarmMapsLib/Jenkinsfile

54 lines
1.5 KiB
Plaintext
Raw Normal View History

2021-06-03 07:37:13 +00:00
pipeline {
agent any
environment {
PACKAGE_VERSION_PREFIX=sh(script: 'jq .version package.json |sed "s/\\"//g"', returnStdout: true).trim()
2021-06-03 07:42:59 +00:00
PACKAGE_VERSION="${PACKAGE_VERSION_PREFIX}"
2021-06-03 07:37:13 +00:00
}
stages {
stage('npm install'){
steps {
sh '''rm -rf node_modules/
2021-11-26 11:02:01 +00:00
npm install --legacy-peer-deps
2021-06-03 07:37:13 +00:00
cd projects/common
2021-11-26 11:02:01 +00:00
npm install --legacy-peer-deps
2021-06-03 07:37:13 +00:00
cd ../common-map
2021-11-26 11:02:01 +00:00
npm install --legacy-peer-deps
2021-06-03 07:37:13 +00:00
cd ../common-map3d
2021-11-26 11:04:17 +00:00
npm install --legacy-peer-deps
2021-06-03 07:37:13 +00:00
'''
}
}
stage('build'){
steps {
2022-01-31 20:51:37 +00:00
sh '''ng build common --configuration production
ng build common-map --configuration production
ng build common-map3d --configuration production'''
2021-06-03 07:37:13 +00:00
}
}
stage('npm publish'){
steps {
sh '''cd dist/common
2021-06-03 07:47:17 +00:00
npm version ${PACKAGE_VERSION} --allow-same-version
2021-06-03 07:37:13 +00:00
npm publish
cd ../common-map
2021-06-03 07:47:17 +00:00
npm version ${PACKAGE_VERSION} --allow-same-version
2021-06-03 07:37:13 +00:00
npm publish
cd ../common-map3d
2021-06-03 07:47:17 +00:00
npm version ${PACKAGE_VERSION} --allow-same-version
2021-06-03 07:37:13 +00:00
npm publish'''
}
}
}
post {
always {
emailext (
body: '${DEFAULT_CONTENT}',
mimeType: 'text/html',
replyTo: '${DEFAULT_REPLYTO}',
subject: '${DEFAULT_SUBJECT}',
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
)
}
}
}