azure - stage 关键字是否在 YAML 文件中定义 Azure DevOps 中的构建或部署管道
问题描述
我想知道我们是否考虑这个 YAML 代码块,如果这已经被认为是一个构建和发布管道......或者我们需要定义阶段来表征它。下面的代码有效,但运行时看不到各个阶段。但是,在这种情况下,它会构建并部署到 Azure。所以这就是我问的原因。我正在寻找正确的术语。这是一个构建和发布管道还是你不能这么说,只有当我定义了构建和发布阶段时,它才是一个。
希望这很清楚。
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
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)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'drop'
downloadPath: '$(System.ArtifactsDirectory)'
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
appType: 'webApp'
WebAppName:
packageForLinux: '$(System.ArtifactsDirectory)/drop/*.zip'
解决方案
在 YAML 中,没有区别。管道就是管道。如果它包含导致软件发布的内容,如果您愿意,请随意将其称为发布管道。
推荐阅读
- python - Clean way to combine list of lists into a dictionary?
- google-maps-markers - 在谷歌地图 api 上显示 50,000 个标记的最佳方法是什么
- image-processing - 如何解码 exif UserComment?
- javascript - 使用 Symfony 进程从 Laravel 执行时出现 Nodejs 错误
- php - Ajax 提交按钮不适用于 PHP/HTML 表单
- reactjs - 设置时在 circle-cl 上计算缓存键时出错
- django - Django Python DetailView 未按预期工作。我在尝试查看特定笔记时遇到问题
- java - 如何从一项活动刷新所有活动
- php - 转换 Twitter 时间戳?
- python - 是否可以从另一个已经运行的进程加载 python 变量?