파이프라인이 소스 코드를 체크 아웃하는 방법을 구성하는 데 사용합니다 checkout
.
steps:
- checkout: string # Required as first property. Configures checkout for the specified repository.
clean: true | false # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
fetchDepth: string # Depth of Git graph to fetch.
fetchFilter: string # Filter Git history.
fetchTags: string # Set to 'true' to sync tags when fetching the repo, or 'false' to not sync tags. See remarks for the default behavior.
lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
sparseCheckoutDirectories: string # Directories for sparse checkout in cone mode and prioritized over sparseCheckoutPatterns if both properties are provided.
sparseCheckoutPatterns: string # Patterns for sparse checkout in non-cone mode that are ignored if sparseCheckoutDirectories is provided.
workspaceRepo: true | false # When true, use the repository root directory as the default working directory for the pipeline. The default is false.
condition: string # Evaluate this condition expression to determine whether to run this task.
continueOnError: boolean # Continue running even on failure?
displayName: string # Human-readable name for the task.
target: string | target # Environment in which to run this task.
enabled: boolean # Run this task when the job runs?
env: # Variables to map into the process's environment.
string: string # Name/value pairs
name: string # ID of the step.
timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
retryCountOnTaskFailure: string # Number of retries if the task fails.
steps:
- checkout: string # Required as first property. Configures checkout for the specified repository.
clean: true | false # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
fetchDepth: string # Depth of Git graph to fetch.
fetchTags: string # Set to 'true' to sync tags when fetching the repo, or 'false' to not sync tags. See remarks for the default behavior.
lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
condition: string # Evaluate this condition expression to determine whether to run this task.
continueOnError: boolean # Continue running even on failure?
displayName: string # Human-readable name for the task.
target: string | target # Environment in which to run this task.
enabled: boolean # Run this task when the job runs?
env: # Variables to map into the process's environment.
string: string # Name/value pairs
name: string # ID of the step.
timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
retryCountOnTaskFailure: string # Number of retries if the task fails.
steps:
- checkout: string # Required as first property. Configures checkout for the specified repository.
clean: true | false # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
fetchDepth: string # Depth of Git graph to fetch.
lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
condition: string # Evaluate this condition expression to determine whether to run this task.
continueOnError: boolean # Continue running even on failure?
displayName: string # Human-readable name for the task.
target: string | target # Environment in which to run this task.
enabled: boolean # Run this task when the job runs?
env: # Variables to map into the process's environment.
string: string # Name/value pairs
name: string # ID of the step.
timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
retryCountOnTaskFailure: string # Number of retries if the task fails.
steps:
- checkout: string # Required as first property. Configures checkout for the specified repository.
clean: true | false # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
fetchDepth: string # Depth of Git graph to fetch.
lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
condition: string # Evaluate this condition expression to determine whether to run this task.
continueOnError: boolean # Continue running even on failure?
displayName: string # Human-readable name for the task.
target: string | target # Environment in which to run this task.
enabled: boolean # Run this task when the job runs?
env: # Variables to map into the process's environment.
string: string # Name/value pairs
name: string # ID of the step.
timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
이 정의를 참조하는 정의: 단계
속성
checkout
문자열입니다. 첫 번째 속성으로 필요합니다.
지정된 리포지토리에 대한 체크 아웃을 구성합니다. , none
리포지토리 이름 또는 리포지토리 리소스를 지정self
합니다. 자세한 내용은 파이프라인에서 여러 리포지토리를 확인하세요.
비고
단계가 없 checkout
으면 기본값은 for jobs.job.step.checkout
및 none
for self
jobs.deployment.steps.checkout
로 설정됩니다.
clean
문자열입니다.
true이면 가져오기 전에 git clean -ffdx, git reset --hard HEAD를 실행합니다. true | false입니다.
fetchDepth
문자열입니다.
가져올 Git 그래프의 깊이입니다.
fetchFilter
문자열입니다.
부분 복제에 대한 Git 기록을 필터링하는 데 사용합니다 fetchFilter
. 이 설정은 fetchFilter
트리리스 및 Blobless 페치를 지원합니다. 트리리스 페치의 경우 Blobless 페치를 지정 fetchFilter: tree:0
하고 지정하려면 .를 지정합니다 fetchFilter: blob:none
. 기본값은 필터링이 아닙니다.
fetchTags
문자열입니다.
리포지토리를 가져올 때 태그를 동기화하려면 'true'로 설정하거나 태그를 동기화하지 않도록 'false'로 설정합니다. 기본 동작에 대한 설명은 참조하세요.
lfs
문자열입니다.
'true'로 설정하여 Git-LFS 파일을 다운로드합니다. 기본값은 다운로드하지 않는 것입니다.
persistCredentials
문자열입니다.
초기 인출 후 Git 구성에 OAuth 토큰을 그대로 두려면 'true'로 설정합니다. 기본값은 그대로 두지 않는 것입니다.
submodules
문자열입니다.
하위 모듈의 하위 모듈의 하위 모듈을 얻으려면 단일 수준의 하위 모듈 또는 '재귀'에 대해 'true'로 설정합니다. 기본값은 하위 모듈을 페치하지 않는 것입니다.
path
문자열입니다.
리포지토리를 배치할 위치입니다. 루트 디렉터리가 $(Pipeline.Workspace)입니다. 기본적으로 이 폴더는 에이전트 작업 디렉터리 구조 아래에 있어야 합니다. 에이전트 작업 디렉터리 외부의 경로를 설정하려면 true로 명명된 AZP_AGENT_ALLOW_WORK_DIRECTORY_REPOSITORIES
파이프라인 변수를 설정하고 체크 아웃 경로의 시작 부분에 접두사를 ../
사용합니다. 에이전트 버전 3.230.0 이상에서 지원됩니다.
sparseCheckoutDirectories
문자열입니다.
디렉터리 일치를 사용하여 원뿔 모드에서 스파스 체크 아웃을 사용하도록 설정하는 디렉터리를 지정합니다. 공백을 사용하여 여러 디렉터리를 구분합니다. Git 2.25 이상을 사용하여 에이전트 버전 3.253.0/4.253.0 이상에서 지원됩니다.
- checkout: repo
sparseCheckoutDirectories: src
둘 다 sparseCheckoutDirectories
sparseCheckoutPatterns
설정 sparseCheckoutDirectories
되면 사용되며 설정 sparseCheckoutPatterns
은 무시됩니다.
스파스 체크 아웃에 대한 자세한 내용은 스파스 체크 아웃을 사용하여 모노레포를 크기로 낮추는 방법을 참조하세요.
sparseCheckoutPatterns
문자열입니다.
패턴 일치를 사용하여 비콘 모드에서 스파스 체크 아웃을 사용하도록 설정하는 패턴을 지정합니다. 공백을 사용하여 여러 패턴을 구분합니다. Git 2.25 이상을 사용하여 에이전트 버전 3.253.0/4.253.0 이상에서 지원됩니다.
- checkout: repo
sparseCheckoutPatterns: /* !/img
둘 다 sparseCheckoutDirectories
sparseCheckoutPatterns
설정 sparseCheckoutDirectories
되면 사용되며 설정 sparseCheckoutPatterns
은 무시됩니다.
스파스 체크 아웃에 대한 자세한 내용은 스파스 체크 아웃을 사용하여 모노레포를 크기로 낮추는 방법을 참조하세요.
workspaceRepo
문자열입니다.
true이면 리포지토리 루트 디렉터리를 파이프라인의 기본 작업 디렉터리로 사용합니다. 기본값은 false입니다.
condition
문자열입니다.
이 조건 식을 평가하여 이 작업을 실행할지 여부를 결정합니다.
부울
실패하더라도 계속 실행하시겠습니까?
displayName
문자열입니다.
작업에 대해 사람이 읽을 수 있는 이름을 .
대상target
.
이 작업을 실행할 환경입니다.
부울
작업이 실행되면 이 작업을 실행하시겠습니까?
문자열 사전을 env
.
변수를 사용하여 프로세스의 환경에 매핑합니다.
name
문자열입니다.
단계의 ID입니다. 허용되는 값: [-_A-Za-z0-9]*.
timeoutInMinutes
문자열입니다.
서버가 종료되기 전에 이 작업이 완료되기를 기다리는 시간입니다.
비고
파이프라인은 작업 수준 시간 제한으로 구성할 수 있습니다. 단계가 완료되기 전에 작업 수준 제한 시간 간격이 경과하면 단계가 더 긴 timeoutInMinutes
간격으로 구성된 경우에도 실행 중인 작업(단계 포함)이 종료됩니다. 자세한 내용은 시간 제한을 참조 하세요.
retryCountOnTaskFailure
문자열입니다.
작업이 실패한 경우 재시도 횟수입니다.
비고
단순 인출
비고
일부 조직에서는 2022년 9월 Azure DevOps 스프린트 209 업데이트 이후에 만든 새 파이프라인이 기본적으로 사용하도록 설정되고 깊이가 1인 단순 페치 있습니다. 이전에는 기본값이 단순 인출이 아니었습니다.
파이프라인을 확인하려면 파이프라인 설정 UI에서 단순 페치 설정을 확인합니다.
단순 인출을 사용하지 않도록 설정하려면 다음 두 가지 옵션 중 하나를 수행할 수 있습니다.
- 파이프라인 설정 UI에서 단순 인출 옵션을 사용하지 않도록 설정합니다.
- 단계에서 명시적으로 설정합니다
fetchDepth: 0
checkout
.
파이프라인에 대한 페치 깊이를 구성하려면 단계에서 속성을 설정 fetchDepth
하거나 파이프라인 설정 UI에서 checkout
단순 페치 설정을 구성할 수 있습니다.
비고
fetchDepth
단계에서 checkout
명시적으로 설정하는 경우 해당 설정은 파이프라인 설정 UI에 구성된 설정보다 우선합니다.
fetchDepth: 0
설정은 모든 기록을 가져오고 단순 페치 설정을 재정의합니다.
Clean 속성
속성이 clean
설정되지 않은 경우 기본값은 YAML 파이프라인에 대한 UI 설정의 정리 설정에 의해 구성되며 기본적으로 true로 설정됩니다. 사용 checkout
가능한 정리 옵션 외에도 작업 영역에서 정리를 구성할 수도 있습니다. 작업 영역 및 정리 옵션에 대한 자세한 내용은 작업 에서 작업 영역 항목을 참조 하세요.
태그 동기화
체크 아웃 단계에서는 Git 리포지토리의 콘텐츠를 가져올 때 --tags
옵션을 사용합니다. 이렇게 하면 서버는 모든 태그와 해당 태그가 가리키는 모든 개체를 가져옵니다. 이렇게 하면 특히 많은 태그가 있는 큰 리포지토리가 있는 경우 파이프라인에서 작업을 실행하는 시간이 늘어나게 됩니다. 또한 체크 아웃 단계는 단순 인출 옵션을 사용하도록 설정한 경우에도 태그를 동기화하므로 용도가 무용지물이 될 수 있습니다. Git 리포지토리에서 가져오거나 가져온 데이터의 양을 줄이기 위해 Microsoft는 태그 동기화 동작을 제어하는 새로운 체크 아웃 옵션을 추가했습니다. 이 옵션은 클래식 및 YAML 파이프라인 모두에서 사용할 수 있습니다.
리포지토리를 체크 아웃할 때 태그를 동기화할지 여부는 fetchTags
속성을 설정하고 동기화 태그를 구성하여 UI에서 구성될 수.
YAML에서 설정을 구성하려면 fetchTags
속성을 설정합니다.
steps:
- checkout: self
fetchTags: true
파이프라인 UI에서 설정을 구성하려면 YAML 파이프라인을 편집하고 추가 작업, 트리거, YAML, 원본 가져오기를 선택하고 동기화 태그 확인란을 선택하거나 선택 취소합니다. 자세한 내용은 동기화 태그를 참조하세요.
기본 동작
- 2022년 9월에 릴리스된 Azure DevOps 스프린트 209릴리스 전에 만든 기존 파이프라인의 경우 동기화 태그 옵션이 추가되기 전에 태그 동기화에 대한 기본값은 기존 동작과 동일하게 유지되며 이는
true
. - Azure DevOps 스프린트 릴리스 209 이후에 만든 새 파이프라인의 경우 태그 동기화의 기본값은
false
.
중요합니다
UI에서 true의 동기화 태그 설정이 YAML의 fetchTags: false
문보다 우선합니다. UI에서 동기화 태그 가 true로 설정된 경우 YAML에서 false로 설정된 경우에도 fetchTags
태그가 동기화됩니다.
예시
에 대한 세 가지 옵션이 있습니다 checkout
. 기본적으로 Azure DevOps는 작업에 대한 현재 리포지토리를 self
체크 아웃합니다. 설정 none
하면 리포지토리가 체크 아웃되지 않습니다. 다른 리포지토리를 지정하면 해당 리포지토리가 체크 아웃됩니다. 다른 리포지토리를 확인하려면 먼저 리포지토리 리소스로 설정합니다.
# Checkout the current repository
steps:
- checkout: self
# Prevent checking out any source code
steps:
- checkout: none
# Checkout a different repository
steps:
- checkout: my-other-repo
원본을 전혀 동기화하지 않도록 하려면 다음을 수행합니다.
steps:
- checkout: none
비고
로컬 서비스 계정에서 에이전트를 실행하고 git 작업을 사용하거나 git 하위 모듈을 로드하여 현재 리포지토리를 수정하려는 경우 프로젝트 컬렉션 빌드 서비스 계정 사용자에게 적절한 권한을 부여합니다.
- checkout: self
submodules: true
persistCredentials: true
파이프라인에서 여러 리포지토리를 확인하려면 여러 checkout
단계를 사용합니다.
- checkout: self
- checkout: git://MyProject/MyRepo
- checkout: MyGitHubRepo # Repo declared in a repository resource
자세한 내용은 파이프라인에서 여러 리포지토리를 확인하세요.