PublishBuildArtifacts@1 - 빌드 아티팩트 v1 작업 게시

빌드 파이프라인에서 이 작업을 사용하여 빌드 아티팩트가 Azure Pipelines, TFS 또는 파일 공유에 게시됩니다.

Azure DevOps Services 사용하는 경우 성능 향상을 위해 파이프라인 아티팩트 다운로드파이프라인 아티팩트 게시를 사용하는 것이 좋습니다.

빌드 파이프라인에서 이 작업을 사용하여 빌드 아티팩트가 Azure Pipelines, TFS 또는 파일 공유에 게시됩니다.

Syntax

# Publish build artifacts v1
# Publish build artifacts to Azure Pipelines or a Windows file share.
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)' # string. Required. Path to publish. Default: $(Build.ArtifactStagingDirectory).
    ArtifactName: 'drop' # string. Required. Artifact name. Default: drop.
    publishLocation: 'Container' # 'Container' | 'FilePath'. Alias: ArtifactType. Required. Artifact publish location. Default: Container.
    #MaxArtifactSize: '0' # string. Max Artifact Size. Default: 0.
    #TargetPath: # string. Required when ArtifactType = FilePath. File share path. 
    #Parallel: false # boolean. Optional. Use when ArtifactType = FilePath. Parallel copy. Default: false.
    #ParallelCount: '8' # string. Optional. Use when ArtifactType = FilePath && Parallel = true. Parallel count. Default: 8.
  # Advanced
    #StoreAsTar: false # boolean. Tar the artifact before uploading. Default: false.
# Publish build artifacts v1
# Publish build artifacts to Azure Pipelines or a Windows file share.
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)' # string. Required. Path to publish. Default: $(Build.ArtifactStagingDirectory).
    ArtifactName: 'drop' # string. Required. Artifact name. Default: drop.
    publishLocation: 'Container' # 'Container' | 'FilePath'. Alias: ArtifactType. Required. Artifact publish location. Default: Container.
    #TargetPath: # string. Required when ArtifactType = FilePath. File share path. 
    #Parallel: false # boolean. Optional. Use when ArtifactType = FilePath. Parallel copy. Default: false.
    #ParallelCount: '8' # string. Optional. Use when ArtifactType = FilePath && Parallel = true. Parallel count. Default: 8.
  # Advanced
    #FileCopyOptions: # string. Optional. Use when ArtifactType = FilePath. File copy options. 
    #StoreAsTar: false # boolean. Tar the artifact before uploading. Default: false.
# Publish build artifacts v1
# Publish build artifacts to Azure Pipelines or a Windows file share.
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)' # string. Required. Path to publish. Default: $(Build.ArtifactStagingDirectory).
    ArtifactName: 'drop' # string. Required. Artifact name. Default: drop.
    publishLocation: 'Container' # 'Container' | 'FilePath'. Alias: ArtifactType. Required. Artifact publish location. Default: Container.
    #TargetPath: # string. Required when ArtifactType = FilePath. File share path. 
    #Parallel: false # boolean. Optional. Use when ArtifactType = FilePath. Parallel copy. Default: false.
    #ParallelCount: '8' # string. Optional. Use when ArtifactType = FilePath && Parallel = true. Parallel count. Default: 8.
  # Advanced
    #FileCopyOptions: # string. Optional. Use when ArtifactType = FilePath. File copy options.
# Publish build artifacts v1
# Publish build artifacts to Azure Pipelines or a Windows file share.
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)' # string. Required. Path to publish. Default: $(Build.ArtifactStagingDirectory).
    ArtifactName: 'drop' # string. Required. Artifact name. Default: drop.
    publishLocation: 'Container' # 'Container' | 'FilePath'. Alias: ArtifactType. Required. Artifact publish location. Default: Container.
    #TargetPath: # string. Required when ArtifactType = FilePath. File share path. 
    #Parallel: false # boolean. Optional. Use when ArtifactType = FilePath. Parallel copy. Default: false.
    #ParallelCount: '8' # string. Optional. Use when ArtifactType = FilePath && Parallel = true. Parallel count. Default: 8.
# Publish Build Artifacts v1
# Publish build artifacts to Azure Pipelines/TFS or a file share.
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)' # string. Required. Path to publish. Default: $(Build.ArtifactStagingDirectory).
    ArtifactName: 'drop' # string. Required. Artifact name. Default: drop.
    publishLocation: 'Container' # 'Container' | 'FilePath'. Alias: ArtifactType. Required. Artifact publish location. Default: Container.
    #TargetPath: # string. Required when ArtifactType = FilePath. File share path. 
    #Parallel: false # boolean. Optional. Use when ArtifactType = FilePath. Parallel copy. Default: false.
    #ParallelCount: '8' # string. Optional. Use when ArtifactType = FilePath && Parallel = true. Parallel count. Default: 8.

입력

PathtoPublish - 게시할 경로
string. 필수 요소. 기본값은 $(Build.ArtifactStagingDirectory)입니다.

게시할 폴더 또는 파일 경로를 지정합니다. 정규화된 경로 또는 리포지토리의 루트에 상대적인 경로일 수 있습니다. 와일드카드는 지원되지 않습니다. 변수가 지원됩니다. 예: $(Build.ArtifactStagingDirectory). 자세한 내용은 파이프라인의 아티팩트 - 개요를 참조하세요.


ArtifactName - 아티팩트 이름
string. 필수 요소. 기본값은 drop입니다.

게시 위치에 만들 아티팩트 이름을 지정합니다. 다음 특수 문자는 허용되지 +않습니다. , , %, {}


publishLocation - 아티팩트 게시 위치
입력 별칭: ArtifactType. string. 필수 요소. 허용되는 값: Container (Azure Pipelines), FilePath (파일 공유). 기본값은 Container입니다.

아티팩트 를 Azure Pipelines(컨테이너)에 저장할지 또는 빌드 에이전트에서 액세스할 수 있어야 하는 파일 공유(FilePath)에 복사할지를 지정합니다. 자세한 내용은 Azure Pipelines의 아티팩트 를 참조하세요.


publishLocation - 아티팩트 게시 위치
입력 별칭: ArtifactType. string. 필수 요소. 허용되는 값: Container (Azure Pipelines/TFS), FilePath (파일 공유). 기본값은 Container입니다.

아티팩트 를 Azure Pipelines(컨테이너)에 저장할지 또는 빌드 에이전트에서 액세스할 수 있어야 하는 파일 공유(FilePath)에 복사할지를 지정합니다. 자세한 내용은 Azure Pipelines의 아티팩트 를 참조하세요.


MaxArtifactSize - 최대 아티팩트 크기
string. 기본값은 0입니다.

게시할 아티팩트 크기에 대한 최대 제한(바이트)입니다. 제한을 설정하지 않으려면 0을 입력합니다.


TargetPath - 파일 공유 경로
string. 필요한 경우 ArtifactType = FilePath입니다.

파일을 복사할 파일 공유의 경로를 지정합니다. 경로는 리포지토리의 루트 디렉터리를 기준으로 정규화된 경로 또는 유효한 경로여야 합니다. Linux 또는 macOS 에이전트에서 파일 공유로 아티팩트 게시는 지원되지 않습니다. 예: \\my\share\$(Build.DefinitionName)\$(Build.BuildNumber).


Parallel - 병렬 복사
boolean. 선택 사항입니다. 를 사용하는 경우 ArtifactType = FilePath를 사용합니다. 기본값은 false입니다.

잠재적 처리량을 높이기 위해 여러 스레드를 사용하여 파일을 병렬로 복사할지 여부를 지정합니다. 이 설정을 사용하도록 설정하지 않으면 단일 스레드가 사용됩니다.


ParallelCount - 병렬 개수
string. 선택 사항입니다. 를 사용하는 경우 ArtifactType = FilePath && Parallel = true를 사용합니다. 기본값은 8입니다.

복사를 수행하는 데 사용되는 병렬 처리 수준(스레드 수)을 지정합니다. 값은 1 이상이어야 하며 128보다 크지 않아야 합니다. 빌드 에이전트의 CPU 기능에 따라 값을 선택합니다.


StoreAsTar - 업로드하기 전에 아티팩트 타르
boolean. 기본값은 false입니다.

업로드하기 전에 게시 경로의 모든 파일을 tar 보관 파일에 추가합니다. 이렇게 하면 UNIX 파일 권한을 유지할 수 있습니다. DownloadBuildArtifacts 작업의 옵션을 사용하여 extractTars 다운로드한 항목을 자동으로 추출합니다. 이 설정은 Windows 에이전트에서 무시됩니다.


FileCopyOptions - 파일 복사 옵션
string. 선택 사항입니다. 를 사용하는 경우 ArtifactType = FilePath를 사용합니다.

Robocopy 명령에 추가 옵션을 전달합니다. 예를 들어 재귀 미니매치 패턴 **/*입니다.


작업 제어 옵션

모든 작업에는 작업 입력 외에 제어 옵션이 있습니다. 자세한 내용은 컨트롤 옵션 및 일반적인 작업 속성을 참조하세요.

출력 변수

없음

설명

참고

이 콘텐츠는 웹 요청에 대한 응답으로 제공되지 않으므로 IIS에서 예약한 Bin, App_Data 및 기타 폴더 이름을 아티팩트 이름으로 사용할 수 없습니다. 자세한 내용은 ASP.NET 웹 프로젝트 폴더 구조를 참조하세요.

예제

steps:
- task: CopyFiles@2
  inputs:
    contents: '_buildOutput/**'
    targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
  inputs:
    pathToPublish: $(Build.ArtifactStagingDirectory)
    artifactName: MyBuildOutputs

요구 사항

요구 사항 Description
파이프라인 유형 YAML, 클래식 빌드
실행 중 에이전트, DeploymentGroup
요청 없음
Capabilities 이 작업은 작업의 후속 작업에 대한 요구를 충족하지 않습니다.
명령 제한 사항 모두
Settable 변수 모두
에이전트 버전 1.91.0 이상
작업 범주 유틸리티

추가 정보