代码拉取完成,页面将自动刷新
pipeline {
agent any
environment{
d_projName='diya-fe'
d_to='pan.fly@qq.com'
}
stages {
stage('Build') {
steps {
echo 'npm install'
bat 'nvm use 12.16.1'
bat 'npm install --registry=https://registry.npm.taobao.org'
echo 'npm run build:prod'
bat 'chcp 65001 && npm run build:prod'
}
}
stage('deploy ') {
steps {
echo "deploy ${BRANCH_NAME}"
echo '7z & bak'
powershell '$version=git log -1 --format=%cd --date=format:%Y%m%d-%H%M%S ; echo $version; 7z a ${env:d_projName}-${env:BRANCH_NAME}.zip .\\dist\\*;cp ${env:d_projName}-${env:BRANCH_NAME}.zip d:\\deploy\\${env:d_projName}-${env:BRANCH_NAME}-$version.zip;'
echo 'push'
sshPublisher(
continueOnError: false, failOnError: true,
publishers: [
sshPublisherDesc(
configName: "47.101.222.130",
verbose: true,
transfers: [
sshTransfer(sourceFiles: "${d_projName}-${BRANCH_NAME}.zip",),
sshTransfer(execCommand: "cmd.exe /c \"d: && cd deploy && doo.bat ${d_projName}-${BRANCH_NAME}\""),
]
)
]
)
echo 'delete tempfile'
powershell 'rm ${env:d_projName}-${env:BRANCH_NAME}.zip -EV Err -EA SilentlyContinue'
}
}
}
post('Generate report') {
always {
echo 'testing email notification'
}
success {
echo 'This will run only if successful'
emailext(
body: '${DEFAULT_CONTENT}',
mimeType: 'text/html',
replyTo: '$DEFAULT_REPLYTO',
subject: '${DEFAULT_SUBJECT}',
to:'973140@qq.com',
recipientProviders: [[$class: 'DevelopersRecipientProvider'],[$class: 'CulpritsRecipientProvider']]
)
}
failure {
echo 'This will run only if failed'
emailext(
body: '${DEFAULT_CONTENT}',
mimeType: 'text/html',
replyTo: '${env.d_to}',
subject: '${DEFAULT_SUBJECT}',
to:'973140@qq.com',
recipientProviders: [[$class: 'DevelopersRecipientProvider'],[$class: 'CulpritsRecipientProvider']]
)
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。