一,引言
我們是否正在為如何快速的編譯、部署客戶端應(yīng)用程序而煩惱?這也是博主最近遇到的問題。目前博主所在公司主要做項(xiàng)目級的定制化開發(fā),多以 C/S 架構(gòu)的 WPF 程序?yàn)橹?,每次到了協(xié)助開發(fā)團(tuán)隊(duì)給實(shí)施團(tuán)隊(duì)編譯好的要測試程序包時(shí),就會出現(xiàn)多人協(xié)助,編譯、打包好的二進(jìn)制程序包 pull 最新代碼 ,以及實(shí)施同事無法及時(shí)的獲取到有新程序發(fā)布的通知等問題。有了這樣的背景,博主所在團(tuán)隊(duì)開始準(zhǔn)備開始了解,使用團(tuán)隊(duì)協(xié)作系統(tǒng) ----- Azure DevOps,通過自動化軟件交付來為用戶提供持續(xù)價(jià)值。
--------------------Azure DevOps 系列--------------------
1,Azure DevOps(一)基于 Net6.0 的 WPF 程序如何進(jìn)行持續(xù)集成、持續(xù)編譯
2,Azure DevOps(二)Azure Pipeline 集成 SonarQube 維護(hù)代碼質(zhì)量和安全性
3,Azure DevOps(三)Azure Pipeline 自動化將程序包上傳到 Azure Blob Storage
二,正文
1, Azure DevOps 創(chuàng)建項(xiàng)目
Project name:”NetCore_WPF_Sample“
Visibility:”Private“(根據(jù)實(shí)際項(xiàng)目需求)
Version control:”Git“
Work item process:”Agile“
點(diǎn)擊 ”Create“ 創(chuàng)建新的項(xiàng)目
2,配置 Azure DevOps 流水線
選擇 ”Pipelines =》“pepelines“,點(diǎn)擊 ”Create Pipeline“ 創(chuàng)建持續(xù)集成管道
選擇 ”GitHUb“ Yaml
選擇好需要項(xiàng)目,開始配置 ”azure-pipelines.yml“
# .NET Desktop # Build and run tests for .NET Desktop or Windows classic desktop solutions. # Add steps that publish symbols, save build artifacts, and more: # https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net trigger: - master pool: vmImage: 'windows-latest' variables: solution: '**/*.sln' buildPlatform: 'Any CPU' buildConfiguration: 'Release' steps: - task: NuGetToolInstaller@1 - task: NuGetCommand@2 inputs: restoreSolution: '$(solution)' - task: VSBuild@1 inputs: solution: '$(solution)' platform: '$(buildPlatform)' configuration: '$(buildConfiguration)' clean: true - task: VSTest@2 inputs: platform: '$(buildPlatform)' configuration: '$(buildConfiguration)' - task: PublishSymbols@2 displayName: 'Publish symbols path' inputs: SearchPattern: '**\bin\**\*.pdb' PublishSymbols: false continueOnError: true - task: CopyFiles@2 displayName: 'Copy Files to: $(build.artifactstagingdirectory)' inputs: SourceFolder: 'Standard.Tool.Platform' Contents: '**\bin\$(BuildConfiguration)\**' TargetFolder: '$(build.artifactstagingdirectory)' condition: succeededOrFailed()
調(diào)整完 yml 文件后,點(diǎn)擊 ”Run“ 執(zhí)行 pipeline?
點(diǎn)擊 ”Run“ 開始執(zhí)行
此時(shí)我們的 pipeline 任務(wù)正在執(zhí)行,我們可以點(diǎn)擊 ”Job“ 查看詳細(xì)作業(yè)
?作業(yè)完成后,我們就可以看到編譯好的程序包
?點(diǎn)擊 ”Download artifacts“ 直接下載編譯好的二進(jìn)制程序包
Bingo!!!????????????????
此演示步驟實(shí)現(xiàn)了 NET 的桌面應(yīng)用程序的持續(xù)集成與持續(xù)編譯,當(dāng)我們 pipeline 監(jiān)測到 master 分支有變動后,就會立即執(zhí)行管道作業(yè),可以確保我們不必再人工拉取代碼,編譯,發(fā)布二進(jìn)制程序包了。
三,結(jié)尾
作者:Allen?文章來源:http://www.zghlxwxcb.cn/news/detail-418766.html
版權(quán):轉(zhuǎn)載請?jiān)谖恼旅黠@位置注明作者及出處。如發(fā)現(xiàn)錯(cuò)誤,歡迎批評指正。文章來源地址http://www.zghlxwxcb.cn/news/detail-418766.html
到了這里,關(guān)于Azure DevOps(一)基于 Net6.0 的 WPF 程序如何進(jìn)行持續(xù)集成、持續(xù)編譯的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!