侧边栏壁纸
博主头像
WinJay博主等级

博观而约取 厚积而薄发

  • 累计撰写 318 篇文章
  • 累计创建 169 个标签
  • 累计收到 1 条评论

目 录CONTENT

文章目录

.Net MSBuild项目-新项目Jenkins构建Demo|新项目|JenkinsFile

WinJay
2021-07-13 / 0 评论 / 0 点赞 / 58 阅读 / 1,553 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2021-12-16,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。
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 已开启"
                    }
                 }
         }
     }
}
0

评论区