36 lines
1.0 KiB
Plaintext
36 lines
1.0 KiB
Plaintext
|
|
pipeline {
|
||
|
|
agent any
|
||
|
|
stages {
|
||
|
|
// stage('清理工作区') {
|
||
|
|
// steps {
|
||
|
|
// cleanWs() // 清理工作区
|
||
|
|
// }
|
||
|
|
// }
|
||
|
|
stage('拉取分支代码') {
|
||
|
|
steps {
|
||
|
|
git branch: "${params.BRANCH}", url: 'git@codeup.aliyun.com:65fa4c5a82cd9138e4d07144/honeycom-ui.git'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
stage('nodejs构建') {
|
||
|
|
steps {
|
||
|
|
sh '/usr/lib/node_modules/npm/bin/npm-cli.js config set registry https://registry.npmmirror.com'
|
||
|
|
sh '/usr/lib/node_modules/npm/bin/npm-cli.js install'
|
||
|
|
sh '/usr/lib/node_modules/npm/bin/npm-cli.js run build'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
stage('Upload') {
|
||
|
|
steps {
|
||
|
|
sshagent(credentials: ['500fb2eb-fbe3-48c2-9ebb-db76d1223f62']) {
|
||
|
|
script {
|
||
|
|
def remote = 'xfusion@172.16.41.10:/opt/honeycom-ui'
|
||
|
|
def localPath = 'dist/'
|
||
|
|
sh "scp -r ${localPath} ${remote}"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
parameters {
|
||
|
|
gitParameter branchFilter: 'origin/(.*)', defaultValue: 'develop', name: 'BRANCH', type: 'PT_BRANCH'
|
||
|
|
}
|
||
|
|
}
|