pipeline{
agent { node { label 'MSBuild' } }
stages{
stage('拉取更新'){
steps{
echo '检测代码更改'
checkout([$class: 'GitSCM', branches: [[name: 'feature/integrated-NERC']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '8888888-8888-8888-8888-888888fe66', url: 'https://git.nercoa.com/fz/resourcescenter/rc/ResourceCenterOrig']]])
}
}
stage('还原Nuget包'){
steps{
bat "$NUGET \"src/Nerc.ResourceLibrary.sln\" "
}
}
stage('版本备份'){
steps{
bat "$MSBUILD \"src/Nerc.ResourceLibrary.FrontEnd\" /t:Compile;_CopyWebApplication /p:Configuration=Release;WebProjectOutputDir=\"D:\\002.ReleaseCode\\${JOB_NAME}\\${BUILD_NUMBER}\";OutputPath=\"D:\\002.ReleaseCode\\${JOB_NAME}\\${BUILD_NUMBER}\\bin\""
echo "文件已备当前版本${JOB_NAME}-${BUILD_NUMBER}"
}
}
stage('发布至测试'){
steps{
echo "Test.AnHui.Nerc.ResourceLibrary.FrontEnd 已停止"
echo '登陆远程'
bat '\r\n net use \\\\Web2\\WebSite password /user:username'
bat "echo d | xcopy /e /y /r /f \"D:\\002.ReleaseCode\\${JOB_NAME}\\${BUILD_NUMBER}\" \"\\\\Web2\\WebSite\\AnHui.Nerc.ResourceLibrary\\FrontEnd\" "
bat "echo d | xcopy /e /y /r /f \"D:\\002.ReleaseCode\\${JOB_NAME}\\${BUILD_NUMBER}\" \"\\\\Web2\\WebSite\\AnHui.Nerc.ResourceLibrary\\FrontEnd_Node1\" "
bat "echo d | xcopy /e /y /r /f \"D:\\002.ReleaseCode\\${JOB_NAME}\\${BUILD_NUMBER}\" \"\\\\Web2\\WebSite\\AnHui.Nerc.ResourceLibrary\\FrontEnd_Node2\" "
}
post {
always {
echo '准备开启站点'
echo "Test.AnHui.Nerc.ResourceLibrary.FrontEnd 已开启"
}
}
}
}
}
评论区