本文介绍了stage 关键字是否在 YAML 文件中定义 Azure DevOps 中的构建或部署管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我们是否考虑这个 YAML 代码块,如果这已经被认为是构建和发布管道......或者我们需要定义阶段来表征它.下面的代码有效,但运行时看不到各个阶段.但是,在这种情况下,它会构建并部署到 Azure.所以这就是我问的原因.我正在寻找正确的术语.这是一个构建和发布管道还是你不能这么说,只有当我定义了构建和发布阶段时,它才是一个.

I would like to know if if we consider this block of YAML code if this is already considered a Build and Release pipeline...or we need to define stages to characterise that. This below code works but you don't see the individual stages when you run this. However it does Build and Deploy to Azure in this case. So that's why I ask. I am looking for correct terminology. Is this a Build and Release pipeline or you can't say that and only if I define the stages Build and Release it is one.

希望这很清楚.

  # 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 中,没有区别.管道就是管道.如果它包含导致软件发布的内容,请随意将其称为发布管道.

In YAML, there's no distinction. A pipeline is a pipeline. If it contains stuff that results in software being released, feel free to call it a release pipeline if you want.

这篇关于stage 关键字是否在 YAML 文件中定义 Azure DevOps 中的构建或部署管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 11:36