Sdílet prostřednictvím


DownloadBuildArtifacts@0 – stažení úlohy artefaktů sestavení v0

Pomocí této úlohy můžete stáhnout soubory, které byly uloženy jako artefakty dokončeného sestavení.

Pokud používáte Azure DevOps Services, pro zajištění vyššího výkonu doporučujeme použít možnost Stáhnout artefakty kanálu a Publikovat artefakty kanálu.

Poznámka

Pokud používáte Azure DevOps Server k povolení ověřování pomocí tokenu PAT, zakažte základní ověřování služby IIS. Další podrobnosti najdete v tématu Základní ověřování služby IIS a tokeny TOKEN.

Stáhněte si artefakty sestavení.

Syntax

# Download build artifacts v0
# Download files that were saved as artifacts of a completed build.
- task: DownloadBuildArtifacts@0
  inputs:
    buildType: 'current' # 'current' | 'specific'. Required. Download artifacts produced by. Default: current.
    #project: # string. Required when buildType == specific. Project. 
    #pipeline: # string. Alias: definition. Required when buildType == specific. Build pipeline. 
    #specificBuildWithTriggering: false # boolean. Optional. Use when buildType == specific. When appropriate, download artifacts from the triggering build. Default: false.
    #buildVersionToDownload: 'latest' # 'latest' | 'latestFromBranch' | 'specific'. Required when buildType == specific. Build version to download. Default: latest.
    #allowPartiallySucceededBuilds: false # boolean. Optional. Use when buildType == specific && buildVersionToDownload != specific. Download artifacts even from partially succeeded builds. Default: false.
    #branchName: 'refs/heads/master' # string. Required when buildType == specific && buildVersionToDownload == latestFromBranch. Branch name. Default: refs/heads/master.
    #buildId: # string. Required when buildType == specific && buildVersionToDownload == specific. Build. 
    #tags: # string. Optional. Use when buildType == specific && buildVersionToDownload != specific. Build Tags. 
    downloadType: 'single' # 'single' | 'specific'. Required. Download type. Default: single.
    artifactName: # string. Required when downloadType == single. Artifact name. 
    #itemPattern: '**' # string. Matching pattern. Default: **.
    downloadPath: '$(System.ArtifactsDirectory)' # string. Required. Destination directory. Default: $(System.ArtifactsDirectory).
    #cleanDestinationFolder: false # boolean. Clean destination folder. Default: false.
  # Advanced
    #parallelizationLimit: '8' # string. Parallelization limit. Default: 8.
    #checkDownloadedFiles: false # boolean. Check downloaded files. Default: false.
    #retryDownloadCount: '4' # string. Retry count. Default: 4.
    #retryRedirectDownloadCount: '0' # string. Retry count for redirect download. Default: 0.
    #extractTars: # boolean. Extract all files that are stored inside tar archives.
# Download build artifacts v0
# Download files that were saved as artifacts of a completed build.
- task: DownloadBuildArtifacts@0
  inputs:
    buildType: 'current' # 'current' | 'specific'. Required. Download artifacts produced by. Default: current.
    #project: # string. Required when buildType == specific. Project. 
    #pipeline: # string. Alias: definition. Required when buildType == specific. Build pipeline. 
    #specificBuildWithTriggering: false # boolean. Optional. Use when buildType == specific. When appropriate, download artifacts from the triggering build. Default: false.
    #buildVersionToDownload: 'latest' # 'latest' | 'latestFromBranch' | 'specific'. Required when buildType == specific. Build version to download. Default: latest.
    #allowPartiallySucceededBuilds: false # boolean. Optional. Use when buildType == specific && buildVersionToDownload != specific. Download artifacts even from partially succeeded builds. Default: false.
    #branchName: 'refs/heads/master' # string. Required when buildType == specific && buildVersionToDownload == latestFromBranch. Branch name. Default: refs/heads/master.
    #buildId: # string. Required when buildType == specific && buildVersionToDownload == specific. Build. 
    #tags: # string. Optional. Use when buildType == specific && buildVersionToDownload != specific. Build Tags. 
    downloadType: 'single' # 'single' | 'specific'. Required. Download type. Default: single.
    artifactName: # string. Required when downloadType == single. Artifact name. 
    #itemPattern: '**' # string. Matching pattern. Default: **.
    downloadPath: '$(System.ArtifactsDirectory)' # string. Required. Destination directory. Default: $(System.ArtifactsDirectory).
    #cleanDestinationFolder: false # boolean. Clean destination folder. Default: false.
  # Advanced
    #parallelizationLimit: '8' # string. Parallelization limit. Default: 8.
    #checkDownloadedFiles: false # boolean. Check downloaded files. Default: false.
    #retryDownloadCount: '4' # string. Retry count. Default: 4.
    #extractTars: # boolean. Extract all files that are stored inside tar archives.
# Download build artifacts v0
# Download files that were saved as artifacts of a completed build.
- task: DownloadBuildArtifacts@0
  inputs:
    buildType: 'current' # 'current' | 'specific'. Required. Download artifacts produced by. Default: current.
    #project: # string. Required when buildType == specific. Project. 
    #pipeline: # string. Alias: definition. Required when buildType == specific. Build pipeline. 
    #specificBuildWithTriggering: false # boolean. Optional. Use when buildType == specific. When appropriate, download artifacts from the triggering build. Default: false.
    #buildVersionToDownload: 'latest' # 'latest' | 'latestFromBranch' | 'specific'. Required when buildType == specific. Build version to download. Default: latest.
    #allowPartiallySucceededBuilds: false # boolean. Optional. Use when buildType == specific && buildVersionToDownload != specific. Download artifacts even from partially succeeded builds. Default: false.
    #branchName: 'refs/heads/master' # string. Required when buildType == specific && buildVersionToDownload == latestFromBranch. Branch name. Default: refs/heads/master.
    #buildId: # string. Required when buildType == specific && buildVersionToDownload == specific. Build. 
    #tags: # string. Optional. Use when buildType == specific && buildVersionToDownload != specific. Build Tags. 
    downloadType: 'single' # 'single' | 'specific'. Required. Download type. Default: single.
    artifactName: # string. Required when downloadType == single. Artifact name. 
    #itemPattern: '**' # string. Matching pattern. Default: **.
    downloadPath: '$(System.ArtifactsDirectory)' # string. Required. Destination directory. Default: $(System.ArtifactsDirectory).
  # Advanced
    #parallelizationLimit: '8' # string. Parallelization limit. Default: 8.
# Download Build Artifacts v0
# Download Build Artifacts.
- task: DownloadBuildArtifacts@0
  inputs:
    buildType: 'current' # 'current' | 'specific'. Required. Download artifacts produced by. Default: current.
    #project: # string. Required when buildType == specific. Project. 
    #pipeline: # string. Alias: definition. Required when buildType == specific. Build pipeline. 
    #specificBuildWithTriggering: false # boolean. Optional. Use when buildType == specific. When appropriate, download artifacts from the triggering build. Default: false.
    #buildVersionToDownload: 'latest' # 'latest' | 'latestFromBranch' | 'specific'. Required when buildType == specific. Build version to download. Default: latest.
    #branchName: 'refs/heads/master' # string. Required when buildType == specific && buildVersionToDownload == latestFromBranch. Branch name. Default: refs/heads/master.
    #buildId: # string. Required when buildType == specific && buildVersionToDownload == specific. Build. 
    #tags: # string. Optional. Use when buildType == specific && buildVersionToDownload != specific. Build Tags. 
    downloadType: 'single' # 'single' | 'specific'. Required. Download type. Default: single.
    artifactName: # string. Required when downloadType == single. Artifact name. 
    #itemPattern: '**' # string. Matching pattern. Default: **.
    downloadPath: '$(System.ArtifactsDirectory)' # string. Required. Destination directory. Default: $(System.ArtifactsDirectory).
  # Advanced
    #parallelizationLimit: '8' # string. Parallelization limit. Default: 8.

Vstupy

buildType - Stažení artefaktů vytvořených
string. Povinná hodnota. Povolené hodnoty: current (Aktuální sestavení), specific (Konkrétní sestavení). Výchozí hodnota: current.

Jestli chcete stáhnout artefakty vytvořené aktuálním sestavením, nebo z konkrétního sestavení.


project - Projektu
string. Vyžaduje se, když buildType == specific.

Projekt, ze kterého chcete stáhnout artefakty sestavení.


pipeline - Kanál sestavení
Alias vstupu: definition. string. Vyžaduje se, když buildType == specific.

Určuje název kanálu buildu.


specificBuildWithTriggering - V případě potřeby stáhněte artefakty z aktivačního sestavení.
boolean. Nepovinný parametr. Použijte, když buildType == specific. Výchozí hodnota: false.

Pokud trueje , tato úloha sestavení se pokusí stáhnout artefakty z aktivačního sestavení. Pokud ze zadaného kanálu neaktivuje žádné sestavení, stáhne artefakty ze sestavení zadaného v následujících možnostech.


buildVersionToDownload - Verze buildu ke stažení
string. Vyžaduje se, když buildType == specific. Povolené hodnoty: latest, latestFromBranch (Nejnovější z konkrétní větve a zadané značky buildu) specific (konkrétní verze). Výchozí hodnota: latest.


allowPartiallySucceededBuilds - Stahujte artefakty i z částečně úspěšných sestavení.
boolean. Nepovinný parametr. Použijte, když buildType == specific && buildVersionToDownload != specific. Výchozí hodnota: false.

Pokud trueje , tato úloha sestavení se pokusí stáhnout artefakty bez ohledu na to, jestli je sestavení úspěšné nebo částečně úspěšné.


branchName - Název větve
string. Vyžaduje se, když buildType == specific && buildVersionToDownload == latestFromBranch. Výchozí hodnota: refs/heads/master.

Určuje, jestli se má filtrovat podle názvu větve nebo odkazu, například: refs/heads/develop.


buildId - Budovat
string. Vyžaduje se, když buildType == specific && buildVersionToDownload == specific.

Sestavení, ze kterého chcete stáhnout artefakty.


tags - Značky sestavení
string. Nepovinný parametr. Použijte, když buildType == specific && buildVersionToDownload != specific.

Seznam značek oddělených čárkami. Vrátí se jenom sestavení s těmito značkami.


downloadType - Typ stahování
string. Povinná hodnota. Povolené hodnoty: single (Konkrétní artefakt), specific (Konkrétní soubory). Výchozí hodnota: single.

Stáhne konkrétní artefakt nebo konkrétní soubory ze sestavení.


artifactName - Název artefaktu
string. Vyžaduje se, když downloadType == single.

Název artefaktu, který se má stáhnout.


itemPattern - Vzor porovnávání
string. Výchozí hodnota: **.

Určuje soubory, které se mají stáhnout, jako víceřádkový vzor minimatch. Další informace najdete v tématu Referenční informace ke vzorům porovnávání souborů.

Výchozí vzor \*\* stáhne všechny soubory napříč všemi artefakty v sestavení, pokud zvolíte možnost Konkrétní soubory . Pokud chcete stáhnout všechny soubory v rámci přetažení artefaktů, použijte drop/**.

.


downloadPath - Cílový adresář
string. Povinná hodnota. Výchozí hodnota: $(System.ArtifactsDirectory).

Cesta na počítači agenta, kam se stahují artefakty.


cleanDestinationFolder - Vyčistit cílovou složku
boolean. Výchozí hodnota: false.

Odstraní všechny existující soubory v cílové složce před stažením artefaktu.


parallelizationLimit - Limit paralelizace
string. Výchozí hodnota: 8.

Počet souborů, které se mají stáhnout současně.


checkDownloadedFiles - Kontrola stažených souborů
boolean. Výchozí hodnota: false.

Pokud trueje , tato úloha sestavení zkontroluje, jestli jsou všechny soubory plně staženy.


retryDownloadCount - Počet opakování
string. Výchozí hodnota: 4.

Počet opakování pokusu o stažení artefaktu sestavení v případě, že se stahování nezdaří.


retryRedirectDownloadCount - Počet opakování pro přesměrování stahování
string. Výchozí hodnota: 0.

Volitelný počet opakování pokusu o stažení artefaktu sestavení, pokud se stahování na základě přesměrování nezdaří. Pokud vaše síť neumožňuje provést přesměrování, můžete ho nastavit na hodnotu -1, abyste místo toho vždy stáhli streamovanou odpověď z Azure DevOps.


extractTars - Extrahování všech souborů uložených v archivech tar
boolean.

Extrahuje všechny stažené soubory, které mají příponu .tar . To je užitečné, protože pokud chcete zachovat oprávnění k souborům unixového .tar souboru, musíte soubory artefaktů zabalit do souboru. Povolení možnosti StoreAsTar v úloze PublishBuildArtifacts ukládá artefakty jako .tar soubory automaticky.


Možnosti ovládání úloh

Všechny úlohy mají kromě vstupů také možnosti ovládání. Další informace najdete v tématu Možnosti ovládacích prvků a běžné vlastnosti úlohy.

Výstupní proměnné

Tato úloha definuje následující výstupní proměnné, které můžete využívat v podřízených krocích, úlohách a fázích.

BuildNumber
Uloží číslo sestavení zdroje artefaktů sestavení.

Upozorňujeme, že tento vstup vrací Id sestavení kvůli zpětné kompatibilitě. Další informace najdete v tématu Proměnné.

Tato úloha definuje následující výstupní proměnné, které můžete využívat v podřízených krocích, úlohách a fázích.

BuildNumber
Uloží číslo sestavení zdroje artefaktů sestavení.

Požadavky

Požadavek Popis
Typy kanálů YAML, klasický build, klasická verze
Běží na Agent, DeploymentGroup
Požadavky Žádné
Možnosti Tento úkol nesplňuje žádné požadavky na následné úkoly v úloze.
Omezení příkazů Všechny
Nastavitelné proměnné Všechny
Verze agenta Všechny podporované verze agenta.
Kategorie úloh Nástroj