Delen via


DownloadBuildArtifacts@0 : buildartefacten v0-taak downloaden

Gebruik deze taak om bestanden te downloaden die zijn opgeslagen als artefacten van een voltooide build.

Als u Azure DevOps Services gebruikt, raden we u aan Pijplijnartefacten downloaden en Pijplijnartefacten publiceren te gebruiken voor snellere prestaties.

Notitie

Schakel IIS-basisverificatie uit als u Azure DevOps Server gebruikt om verificatie met uw persoonlijke toegangstoken toe te staan. Zie IIS-basisverificatie en PAW's voor meer informatie.

Download buildartefacten.

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.

Invoerwaarden

buildType - Artefacten downloaden die zijn geproduceerd door
string. Vereist. Toegestane waarden: current (Huidige build), specific (Specifieke build). Standaardwaarde: current.

Of u artefacten wilt downloaden die zijn geproduceerd door de huidige build of van een specifieke build.


project - Project
string. Vereist wanneer buildType == specific.

Het project van waaruit u de buildartefacten wilt downloaden.


pipeline - Build-pijplijn
Invoeralias: definition. string. Vereist wanneer buildType == specific.

Hiermee geeft u de naam van de build-pijplijn op.


specificBuildWithTriggering - Download, indien van toepassing, artefacten uit de activerende build.
boolean. Optioneel. Gebruik wanneer buildType == specific. Standaardwaarde: false.

Als true, probeert deze buildtaak artefacten te downloaden van de activerende build. Als er geen build wordt geactiveerd vanuit de opgegeven pijplijn, worden artefacten gedownload van de build die is opgegeven in de onderstaande opties.


buildVersionToDownload - Buildversie om te downloaden
string. Vereist wanneer buildType == specific. Toegestane waarden: latest, latestFromBranch (Meest recente van specifieke vertakking en opgegeven buildtags), specific (specifieke versie). Standaardwaarde: latest.


allowPartiallySucceededBuilds - Download artefacten, zelfs van gedeeltelijk geslaagde builds.
boolean. Optioneel. Gebruik wanneer buildType == specific && buildVersionToDownload != specific. Standaardwaarde: false.

Als true, probeert deze buildtaak artefacten te downloaden, ongeacht of de build slaagt of gedeeltelijk slaagt.


branchName - Naam van vertakking
string. Vereist wanneer buildType == specific && buildVersionToDownload == latestFromBranch. Standaardwaarde: refs/heads/master.

Hiermee geeft u op of moet worden gefilterd op vertakkings-/verw-naam, bijvoorbeeld: refs/heads/develop.


buildId - Bouwen
string. Vereist wanneer buildType == specific && buildVersionToDownload == specific.

De build waaruit u de artefacten wilt downloaden.


tags - BuildTags
string. Optioneel. Gebruik wanneer buildType == specific && buildVersionToDownload != specific.

Een door komma's gescheiden lijst met tags. Alleen builds met deze tags worden geretourneerd.


downloadType - Downloadtype
string. Vereist. Toegestane waarden: single (Specifiek artefact), specific (Specifieke bestanden). Standaardwaarde: single.

Hiermee downloadt u een specifiek artefact of specifieke bestanden uit de build.


artifactName - Naam van artefact
string. Vereist wanneer downloadType == single.

De naam van het artefact dat moet worden gedownload.


itemPattern - Overeenkomend patroon
string. Standaardwaarde: **.

Hiermee geeft u de bestanden te downloaden als een minimatchpatroon met meerdere regels. Zie Naslaginformatie over bestandsmatchingspatronen voor meer informatie.

Met het standaardpatroon \*\* worden alle bestanden voor alle artefacten in de build gedownload als u de optie Specifieke bestanden kiest. Als u alle bestanden in de artefact-drop wilt downloaden, gebruikt u drop/**.

.


downloadPath - Doelmap
string. Vereist. Standaardwaarde: $(System.ArtifactsDirectory).

Het pad op de agentmachine waar de artefacten worden gedownload.


cleanDestinationFolder - Doelmap opschonen
boolean. Standaardwaarde: false.

Hiermee verwijdert u alle bestaande bestanden in de doelmap voordat het artefact wordt gedownload.


parallelizationLimit - Limiet voor parallellisatie
string. Standaardwaarde: 8.

Het aantal bestanden dat tegelijkertijd moet worden gedownload.


checkDownloadedFiles - Gedownloade bestanden controleren
boolean. Standaardwaarde: false.

Als true, controleert deze buildtaak of alle bestanden volledig zijn gedownload.


retryDownloadCount - Aantal nieuwe pogingen
string. Standaardwaarde: 4.

Het aantal keren dat een buildartefact opnieuw moet worden gedownload als het downloaden mislukt.


retryRedirectDownloadCount - Aantal nieuwe pogingen voor het downloaden van omleiding
string. Standaardwaarde: 0.

Optioneel aantal keren dat u een buildartefact opnieuw wilt downloaden als het downloaden op basis van omleiding mislukt. Als uw netwerk het volgen van de omleiding niet toestaat, kunt u dit instellen op -1 om in plaats daarvan altijd gestreamde reacties van Azure DevOps te downloaden.


extractTars - Alle bestanden extraheren die zijn opgeslagen in tar-archieven
boolean.

Hiermee worden alle gedownloade bestanden uitgepakt die een .tar extensie hebben. Dit is handig omdat u uw artefactbestanden in een .tar bestand moet inpakken als u de machtigingen voor Unix-bestanden wilt behouden. Als u de StoreAsTar optie inschakelt in de taak PublishBuildArtifacts, worden artefacten automatisch als .tar bestanden opgeslagen.


Opties voor taakbeheer

Alle taken hebben besturingsopties naast hun taakinvoer. Zie Besturingsopties en algemene taakeigenschappen voor meer informatie.

Uitvoervariabelen

Deze taak definieert de volgende uitvoervariabelen, die u kunt gebruiken in downstreamstappen, taken en fasen.

BuildNumber
Hiermee wordt het buildnummer van de build-artefactbron opgeslagen.

Houd er rekening mee dat deze invoer BuildId retourneert vanwege compatibiliteit met eerdere versies. Zie Variabelen voor meer informatie.

Deze taak definieert de volgende uitvoervariabelen, die u kunt gebruiken in downstreamstappen, taken en fasen.

BuildNumber
Hiermee wordt het buildnummer van de build-artefactbron opgeslagen.

Vereisten

Vereiste Beschrijving
Pijplijntypen YAML, klassieke build, klassieke release
Wordt uitgevoerd op Agent, DeploymentGroup
Eisen Geen
Functies Deze taak voldoet niet aan eventuele vereisten voor volgende taken in de taak.
Opdrachtbeperkingen Alle
Instelbare variabelen Alle
Agentversie Alle ondersteunde agentversies.
Taakcategorie Hulpprogramma