侧边栏壁纸
博主头像
★街角晚灯★博主等级

博观而约取 厚积而薄发

  • 累计撰写 461 篇文章
  • 累计创建 184 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

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

WinJay
2021-07-13 / 0 评论 / 0 点赞 / 133 阅读 / 2138 字 / 正在检测是否收录...
温馨提示:
文章发布较早,内容可能过时,阅读注意甄别。。。。
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
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区