stage 关键字是否在 YAML 文件中的 Azure DevOps 中定义构建或部署管道

2023-12-02

我想知道我们是否考虑这个 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://learn.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 中,没有区别。管道就是管道。如果它包含导致软件发布的内容,如果您愿意,可以随意将其称为发布管道。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

stage 关键字是否在 YAML 文件中的 Azure DevOps 中定义构建或部署管道 的相关文章

随机推荐