azure-devops - Azure DevOps yaml 管道 : how to download only specific artifacts of a referenced pipeline?

标签 azure-devops azure-pipelines

通过引用 YAML 管道资源中的另一个管道,引用管道发布的所有工件都会自动下载。我不确定如何停止此行为并仅下载所需的工件。仅为所需工件添加下载任务不会停止全套工件的初始下载。

最佳答案

所以你需要的是disabling default behavior作为

Artifacts are only downloaded automatically in deployment jobs. In a regular build job, you need to explicitly use the download step keyword or Download Pipeline Artifact task.

To stop artifacts from being downloaded automatically, add a download step and set its value to none:

steps:
- download: none

然后添加额外的步骤来下载特定的工件。

这是一个例子:


resources:
  pipelines:
  - pipeline: MultipleArtifact
    project: 'DevOps Manual'
    source: 'kmadof.devops-manual (64)'

jobs:
- job: Build
  pool:
    vmImage: 'ubuntu-latest'
  steps:
  - script: echo Hello, world!
    displayName: 'Run a one-line script'

  - script: |
      echo Add other tasks to build, test, and deploy your project.
      echo See https://aka.ms/yaml
    displayName: 'Run a multi-line script'

  # Track deployments on the environment.
- deployment: DeployWeb
  displayName: deploy Web App
  pool:
    vmImage: 'Ubuntu-16.04'
  # Creates an environment if it doesn't exist.
  environment: 'smarthotel-dev'
  strategy:
    # Default deployment strategy, more coming...
    runOnce:
      deploy:
        steps:
        - download: none
        - download: MultipleArtifact
          artifact: art-1
        - checkout: self 
        - script: echo my first deployment

enter image description here

关于azure-devops - Azure DevOps yaml 管道 : how to download only specific artifacts of a referenced pipeline?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65308235/

相关文章:

azure-devops - 在Azure DevOps发布管道中,如何将最新版本提升到一段时间内没有发布版本的阶段?

react-native - 如何在构建 React Native 应用程序时在 Microsoft AppCenter 中将 npm install 命令配置为 "npm install --legacy-peer-deps"

azure-devops - 使用 AzureDevOps 构建代理使用托管标识从应用服务建立安全的 Azure SQL 数据库连接

javascript - azure devops 中的 Testcafe 具有特定 URL

sql-server - 直接从 SQL Server 获取 Azure ML 中的数据

azure-pipelines - 外部 repo 更改时 VSTS 触发构建

visual-studio-2008 - 如何将Visual Studio 2008连接到Team Foundation Service和Visual Studio Online?

azure - 无法选择在 azure devops 中使用托管标识来连接容器注册表

Git:克隆时显示消息

azure - 在 Azure Pipelines 中使用托管标识 : GetUserAccessToken: Failed to obtain an access token of identity. AAD 返回静默失败