提交web端持续集成脚本
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
parameters {
|
parameters {
|
||||||
string(name: 'pid', defaultValue: '', description: '定制方案的Id')
|
string(name: 'pid', defaultValue: '', description: '定制方案的Id'),
|
||||||
|
string(name: 'dist', defaultValue: '', description: '部署路径')
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('拉取代码') {
|
stage('拉取代码') {
|
||||||
@@ -19,6 +20,7 @@ pipeline {
|
|||||||
stage('打包') {
|
stage('打包') {
|
||||||
steps {
|
steps {
|
||||||
echo "正在打包的工程==>: ${params.pid}"
|
echo "正在打包的工程==>: ${params.pid}"
|
||||||
|
sh "npm i"
|
||||||
sh "node bin/build.js ${params.pid}&&npm run build"
|
sh "node bin/build.js ${params.pid}&&npm run build"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,7 +30,7 @@ pipeline {
|
|||||||
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 ${params.dist} && ls -a && tar -zxvf dist.tar.gz -C dist && rm -rf dist.tar.gz',
|
execCommand: "cd ${params.dist} && ls -a && tar -zxvf dist.tar.gz -C dist && rm -rf dist.tar.gz",
|
||||||
remoteDirectory: 'zips')
|
remoteDirectory: 'zips')
|
||||||
], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)])
|
], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: true)])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user