3 Star 0 Fork 0

pandady/pandy-diya

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Jenkinsfile 2.34 KB
一键复制 编辑 原始数据 按行查看 历史
潘泉景 提交于 2020-07-29 22:38 . deploy file 优化npm安装源
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']]
)
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pandady/pandy-diya.git
git@gitee.com:pandady/pandy-diya.git
pandady
pandy-diya
pandy-diya
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385