测试集成脚本
This commit is contained in:
19
oms_jenkins
19
oms_jenkins
@@ -19,19 +19,19 @@ pipeline {
|
|||||||
stage('打包') {
|
stage('打包') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Building...'
|
echo 'Building...'
|
||||||
sh 'npm i && npm run build'
|
sh 'docker build -t oms-node-service .'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('部署') {
|
stage('部署') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Deploying...'
|
echo 'Deploying...'
|
||||||
// 这里可以添加测试步骤
|
// 这里可以添加测试步骤
|
||||||
sh 'tar -zcvf dist.tar.gz -C dist .'
|
// sh 'tar -zcvf dist.tar.gz -C dist .'
|
||||||
sshPublisher(publishers: [sshPublisherDesc(configName: 'dev87', transfers: [sshTransfer(
|
// sshPublisher(publishers: [sshPublisherDesc(configName: 'dev87', transfers: [sshTransfer(
|
||||||
sourceFiles: 'dist.tar.gz',
|
// sourceFiles: 'dist.tar.gz',
|
||||||
execCommand: 'cd /mnt/sdc/web/ && ls -a && tar -zxvf dist.tar.gz -C dist && rm -rf dist.tar.gz',
|
// execCommand: 'cd /mnt/sdc/web/ && ls -a && tar -zxvf dist.tar.gz -C dist && rm -rf dist.tar.gz',
|
||||||
remoteDirectory: 'web')
|
// remoteDirectory: 'web')
|
||||||
], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)])
|
// ], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,15 +43,14 @@ pipeline {
|
|||||||
def currentTime = new Date().format('yyyy-MM-dd HH:mm:ss', TimeZone.getTimeZone('Asia/Shanghai'))
|
def currentTime = new Date().format('yyyy-MM-dd HH:mm:ss', TimeZone.getTimeZone('Asia/Shanghai'))
|
||||||
|
|
||||||
sh """
|
sh """
|
||||||
curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=bcabdfc6-e325-49bc-9442-5d3398c1d3ec' \\
|
curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=5c25c37c-0b91-4d1d-95d3-98a2bb7055c7' \\
|
||||||
-H 'Content-Type: application/json' \\
|
-H 'Content-Type: application/json' \\
|
||||||
-d '{
|
-d '{
|
||||||
"msgtype": "markdown",
|
"msgtype": "markdown",
|
||||||
"markdown": {
|
"markdown": {
|
||||||
"content": ">构建结果:oms构建打包服务部署完成!\\n
|
"content": ">构建结果:oms构建打包服务部署完成!\\n
|
||||||
>完成时间:${currentTime}\\n
|
>完成时间:${currentTime}\\n
|
||||||
>构建时间:${currentBuild.durationString}"
|
>构建时间:${currentBuild.durationString}"
|
||||||
|
|
||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user