Condividi tramite


DownloadBuildArtifacts@0 - Scaricare elementi di compilazione v0 attività

Usare questa attività per scaricare i file salvati come artefatti di una compilazione completata.

Se si usa Azure DevOps Services, è consigliabile usare Scarica artefatti della pipeline e Pubblica artefattidella pipeline per prestazioni più veloci.

Nota

Disabilitare l'autenticazione di base IIS se si usa Azure DevOps Server per consentire l'autenticazione con il token di accesso personale. Per altre informazioni, vedere Autenticazione di base e PAT IIS .

Scaricare gli artefatti di compilazione.

Sintassi

# 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.

Input

buildType - Scaricare gli artefatti prodotti da
string. Obbligatorio. Valori consentiti: current (build corrente), specific (compilazione specifica). Valore predefinito: current.

Se scaricare gli artefatti prodotti dalla compilazione corrente o da una compilazione specifica.


project - Progetto
string. Obbligatorio quando buildType == specific.

Progetto da cui si desidera scaricare gli artefatti di compilazione.


pipeline - Pipeline di compilazione
Alias di input: definition. string. Obbligatorio quando buildType == specific.

Specifica il nome della pipeline di compilazione.


specificBuildWithTriggering - Se appropriato, scaricare gli artefatti dalla compilazione di attivazione.
boolean. facoltativo. Usare quando buildType == specific. Valore predefinito: false.

Se true, questa attività di compilazione tenta di scaricare gli artefatti dalla compilazione di attivazione. Se non esiste alcuna compilazione attiva dalla pipeline specificata, scarica gli artefatti dalla compilazione specificata nelle opzioni seguenti.


buildVersionToDownload - Versione di compilazione da scaricare
string. Obbligatorio quando buildType == specific. Valori consentiti: latest, latestFromBranch (più recente da un ramo specifico e tag di compilazione specificati), specific (versione specifica). Valore predefinito: latest.


allowPartiallySucceededBuilds - Scaricare elementi anche da compilazioni parzialmente riuscite.
boolean. facoltativo. Usare quando buildType == specific && buildVersionToDownload != specific. Valore predefinito: false.

Se true, questa attività di compilazione tenta di scaricare gli artefatti se la compilazione ha esito positivo o parziale.


branchName - Nome ramo
string. Obbligatorio quando buildType == specific && buildVersionToDownload == latestFromBranch. Valore predefinito: refs/heads/master.

Specifica se filtrare in branch/ref name, ad esempio: refs/heads/develop.


buildId - Costruire
string. Obbligatorio quando buildType == specific && buildVersionToDownload == specific.

Compilazione da cui scaricare gli artefatti.


tags - Tag di compilazione
string. facoltativo. Usare quando buildType == specific && buildVersionToDownload != specific.

Elenco delimitato da virgole di tag. Vengono restituite solo build con questi tag.


downloadType - Tipo di download
string. Obbligatorio. Valori consentiti: single (artefatto specifico), specific (file specifici). Valore predefinito: single.

Scarica un artefatto specifico o file specifici dalla compilazione.


artifactName - Nome artefatto
string. Obbligatorio quando downloadType == single.

Nome dell'artefatto da scaricare.


itemPattern - Modello di corrispondenza
string. Valore predefinito: **.

Specifica i file da scaricare come modello minimatch a più righe. Per altre informazioni, vedere Informazioni di riferimento sui modelli di corrispondenza dei file.

Il modello \*\* predefinito scarica tutti i file in tutti gli artefatti della compilazione se si sceglie l'opzione File specifici . Per scaricare tutti i file all'interno dell'elenco a discesa dell'artefatto, usare drop/**.

.


downloadPath - Directory di destinazione
string. Obbligatorio. Valore predefinito: $(System.ArtifactsDirectory).

Percorso nel computer dell'agente in cui vengono scaricati gli artefatti.


cleanDestinationFolder - Pulire la cartella di destinazione
boolean. Valore predefinito: false.

Elimina tutti i file esistenti nella cartella di destinazione prima del download dell'artefatto.


parallelizationLimit - Limite di parallelizzazione
string. Valore predefinito: 8.

Numero di file da scaricare contemporaneamente.


checkDownloadedFiles - Controllare i file scaricati
boolean. Valore predefinito: false.

Se true, questa attività di compilazione verifica che tutti i file siano completamente scaricati.


retryDownloadCount - Conteggio dei tentativi
string. Valore predefinito: 4.

Numero di tentativi di ripetizione del download di un artefatto di compilazione se il download ha esito negativo.


retryRedirectDownloadCount - Numero di tentativi per il download di reindirizzamento
string. Valore predefinito: 0.

Numero facoltativo di tentativi per ripetere il download di un artefatto di compilazione se il download in base al reindirizzamento ha esito negativo. Se la rete non consente di eseguire il reindirizzamento, è possibile impostare questa opzione su -1 per scaricare sempre la risposta in streaming da Azure DevOps.


extractTars - Estrarre tutti i file archiviati all'interno di archivi tar
boolean.

Estrae tutti i file scaricati con estensione .tar . Questo è utile perché è necessario inserire i file di artefatti in un .tar file se si desidera mantenere le autorizzazioni per i file Unix. L'abilitazione dell'opzione nell'attività StoreAsTar PublishBuildArtifacts archivia automaticamente gli artefatti come .tar file.


Opzioni di controllo delle attività

Tutte le attività dispongono di opzioni di controllo oltre ai relativi input attività. Per altre informazioni, vedere Opzioni di controllo e proprietà comuni delle attività.

Variabili di output

Questa attività definisce le variabili di output seguenti, che è possibile usare nei passaggi, nei processi e nelle fasi downstream.

BuildNumber
Archivia il numero di compilazione dell'origine dell'artefatto di compilazione.

Si noti che questo input restituisce BuildId a causa della compatibilità con le versioni precedenti. Per altre informazioni, vedere Variabili.

Questa attività definisce le variabili di output seguenti, che è possibile usare nei passaggi, nei processi e nelle fasi downstream.

BuildNumber
Archivia il numero di compilazione dell'origine dell'artefatto di compilazione.

Requisiti

Requisito Descrizione
Tipi di pipeline YAML, build classica, versione classica
Esecuzione in Agente, DeploymentGroup
Richieste Nessuno
Capabilities Questa attività non soddisfa le richieste per le attività successive nel processo.
Restrizioni dei comandi Qualsiasi
Variabili impostabili Qualsiasi
Versione agente Tutte le versioni dell'agente supportate.
Categoria attività Utilità