steps.checkout tanımı
İşlem hattının kaynak kodu nasıl kullanıma aldıracaklarını yapılandırmak için checkout
kullanın.
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.
steps:
- checkout: string # Required as first property. Whether or not to check out the repository containing this pipeline definition.
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.
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.
steps:
- checkout: string # Required as first property. Whether or not to check out the repository containing this pipeline definition.
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.
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.
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.
Bu tanıma başvuran tanımlar: adımlar
Özellikler
checkout
dize. İlk özellik olarak gereklidir.
Belirtilen depo için kullanıma alma işlemini yapılandırıyor.
self
, none
, depo adı veya depo kaynağıbelirtin. Daha fazla bilgi için bkz. İşlem hattıbirden çok depoya göz atın.
Not
checkout
bir adım yoksa, varsayılan olarak jobs.job.step.checkout
için self
ve jobs.deployment.steps.checkout
için none
olur.
checkout
dize. İlk özellik olarak gereklidir.
bu işlem hattı tanımını içeren deponun kullanıma alınıp alınmayacağını .
self
veya none
belirtin.
clean
dize.
True ise git clean -ffdx çalıştırın ve ardından getirmeden önce git reset --hard HEAD komutunu çalıştırın. true | false değerini seçin.
fetchDepth
dize.
Getirilmeye Git grafiğinin derinliği.
fetchFilter
dize.
Git geçmişini kısmi kopyalama için filtrelemek için fetchFilter
kullanın.
fetchFilter
ayarı, ağaçsız ve blobsuz getirmeleri destekler. Ağaçsız getirme için fetchFilter: tree:0
belirtin ve blobsuz getirme belirtmek için fetchFilter: blob:none
belirtin. Varsayılan değer filtreleme değildir.
fetchTags
dize.
Depo getirilirken etiketleri eşitlemek için 'true' olarak, etiketleri eşitlememek için ise 'false' olarak ayarlayın. Varsayılan davranış için açıklamalar bölümüne bakın.
lfs
dize.
Git-LFS dosyaları indirmek için 'true' olarak ayarlayın. Varsayılan ayar bunları indirmemektir.
persistCredentials
dize.
İlk getirme işleminden sonra Git yapılandırmasında OAuth belirtecini bırakmak için 'true' olarak ayarlayın. Varsayılan değer, bırakmamaktır.
submodules
dize.
Alt modüllerin alt modüllerini almak için tek bir alt modül düzeyi için 'true' veya 'özyinelemeli' olarak ayarlayın. Varsayılan değer alt modülleri getirmek değildir.
path
dize.
deponun nereye yerleştirileceğine . Kök dizin $(Pipeline.Workspace) dizinidir. Varsayılan olarak bu klasör aracı çalışma dizini yapısı altında olmalıdır. Aracı çalışma dizininin dışında bir yol ayarlamak için AZP_AGENT_ALLOW_WORK_DIRECTORY_REPOSITORIES
adlı bir işlem hattı değişkenini true olarak ayarlayın ve ödeme yolunuzun başındaki ön ek ../
kullanın. Aracı 3.230.0 ve üzeri sürümlerde desteklenir.
sparseCheckoutDirectories
dize.
Dizin eşleştirmeyi kullanarak koni modunda seyrek kullanıma alma özelliğini etkinleştirmek için bir dizin belirtin. Boşluk kullanarak birden çok dizini ayırın.
- checkout: repo
sparseCheckoutDirectories: src
Hem sparseCheckoutDirectories
hem de sparseCheckoutPatterns
ayarlanırsa, sparseCheckoutDirectories
kullanılır ve sparseCheckoutPatterns
ayarı göz ardı edilir.
Seyrek kullanıma alma hakkında daha fazla bilgi için bkz. Seyrek kullanıma alma ile monoreponuzu boyuta getirme.
sparseCheckoutPatterns
dize.
Desen eşleştirmeyi kullanarak koni olmayan modda seyrek kullanıma alma özelliğini etkinleştirmek için bir desen belirtin. Boşluk kullanarak birden çok deseni ayırın.
- checkout: repo
sparseCheckoutPatterns: /* !/img
Hem sparseCheckoutDirectories
hem de sparseCheckoutPatterns
ayarlanırsa, sparseCheckoutDirectories
kullanılır ve sparseCheckoutPatterns
ayarı göz ardı edilir.
Seyrek kullanıma alma hakkında daha fazla bilgi için bkz. Seyrek kullanıma alma ile monoreponuzu boyuta getirme.
workspaceRepo
dize.
True olduğunda, işlem hattı için varsayılan çalışma dizini olarak depo kök dizinini kullanın. Varsayılan değer false'tur.
condition
dize.
Bu görevin çalıştırılıp çalıştırılmayacağını belirlemek için Bu koşul ifadesini değerlendirin.
boolecontinueOnError
.
Hata durumunda bile çalışmaya devam ?
displayName
dize.
Görev için İnsan tarafından okunabilir bir ad .
hedeftarget
.
bu görevin çalıştırıldığı ortamı .
booleenabled
.
İş çalıştırıldığında bu görevi çalıştır ?
dize sözlüğü env
.
İşlemin ortamına eşlemek için Değişkenleri .
name
dize.
Adımın kimliği. Kabul edilebilir değerler: [-_A-Za-z0-9]*.
timeoutInMinutes
dize.
Sunucu görevi sonlandırmadan önce bu görevin tamamlanmasını bekleme süresi.
Not
İşlem hatları iş düzeyi zaman aşımı ile yapılandırılabilir. İş düzeyi zaman aşımı aralığı adımınız tamamlanmadan önce geçerse, adım daha uzun bir timeoutInMinutes
aralığıyla yapılandırılmış olsa bile çalışan iş (adımınız dahil) sonlandırılır. Daha fazla bilgi için bkz. Zaman Aşımları.
retryCountOnTaskFailure
dize.
Görev başarısız olursa yeniden deneme sayısı.
Açıklamalar
Sığ getirme
Not
Bazı kuruluşlarda, Eylül 2022 Azure DevOps sprint 209 güncelleştirme sonra oluşturulan yeni işlem hatları, Sığ getirme varsayılan olarak etkindir ve 1 derinliğiyle yapılandırılır. Önceden varsayılan değer basit getirme değildi.
İşlem hattınızı denetlemek için, işlem hattı ayarları kullanıcı arabirimiSığ getirme ayarını görüntüleyin.
Basit getirme özelliğini devre dışı bırakmak için aşağıdaki iki seçenekten birini gerçekleştirebilirsiniz.
- işlem hattı ayarları kullanıcı arabiriminde Sığ getirme seçeneğini devre dışı bırakın.
-
checkout
adımınızdafetchDepth: 0
açıkça ayarlayın.
İşlem hattının getirme derinliğini yapılandırmak için checkout
adımında fetchDepth
özelliğini ayarlayabilir veya işlem hattı ayarları kullanıcı arabiriminde Sığ getirme ayarını yapılandırabilirsiniz.
Not
checkout
adımınızda fetchDepth
açıkça ayarlarsanız, bu ayar işlem hattı ayarları kullanıcı arabiriminde yapılandırılan ayara göre önceliklidir. ayar fetchDepth: 0
tüm geçmişi getirir ve Sığ getirme ayarını geçersiz kılar.
Clean özelliği
clean
özelliği ayarlanmamışsa, varsayılan değeri YAML işlem hatlarının kullanıcı arabirimi ayarlarındaki temiz ayarı tarafından yapılandırılır ve varsayılan olarak true olarak ayarlanır.
checkout
kullanılarak sağlanan temizleme seçeneğine ek olarak, bir çalışma alanında temizlemeyi de yapılandırabilirsiniz. Çalışma alanları ve temiz seçenekler hakkında daha fazla bilgi için, İşlerçalışma alanı konusuna bakın.
Etiketleri eşitleme
Kullanıma alma adımı, Git deposunun içeriğini getirirken --tags
seçeneğini kullanır. Bu, sunucunun hem tüm etiketleri hem de bu etiketler tarafından işaret edilen tüm nesneleri getirmesine neden olur. Bu, özellikle çok sayıda etiket içeren büyük bir deponuz varsa, işlem hattında görevi çalıştırma süresini artırır. Ayrıca, kullanıma alma adımı, sığ getirme seçeneğini etkinleştirdiğinizde bile etiketleri eşitler ve böylece amacını yenebilir. Git deposundan getirilen veya çekilen veri miktarını azaltmak için Microsoft, etiketleri eşitleme davranışını denetlemek için kullanıma alma seçeneği eklemiştir. Bu seçenek hem klasik hem de YAML işlem hatlarında kullanılabilir.
Depoyu kullanıma alırken etiketlerin eşitlenip eşitlenmeyeceği YAML'de fetchTags
özelliği ayarlanarak ve Eşitleme etiketleri ayarı yapılandırılarak kullanıcı arabiriminde yapılandırılabilir.
YAML'de ayarı yapılandırmak için fetchTags
özelliğini ayarlayın.
steps:
- checkout: self
fetchTags: true
İşlem hattı kullanıcı arabiriminde ayarı yapılandırmak için YAML işlem hattınızı düzenleyin ve Diğer eylemlerseçin, Tetikleyiciler, YAML, Kaynaklarıal ve Eşitleme etiketleri onay kutusunu işaretleyin veya işaretini kaldırın. Daha fazla bilgi için bkz. Eşitleme etiketleri.
Varsayılan davranış
- Eylül 2022'de yayımlanan Azure DevOps sprint 209yayımlanmadan önce oluşturulan mevcut işlem hatları için, etiketleri eşitlemek için varsayılan değer,
true
Eşitleme etiketleri seçenekleri eklenmeden önceki mevcut davranışla aynı kalır. - Azure DevOps sprint sürümü 209'undan sonra oluşturulan yeni işlem hatları için etiketleri eşitlemek için varsayılan değer
false
.
Önemli
Eşitleme etiketleri kullanıcı arabirimindeki true ayarı YAML'deki fetchTags: false
deyiminden önceliklidir.
Eşitleme etiketleri kullanıcı arabiriminde true olarak ayarlanırsa, YAML'de fetchTags
false olarak ayarlansa bile etiketler eşitlenir.
Örnekler
checkout
için üç seçenek vardır. Azure DevOps varsayılan olarak işler için self
ile geçerli depoyu kullanıma alır.
none
ayarladığınızda hiçbir depo kullanıma alınmaz. Başka bir depo belirtirseniz, bu depo kullanıma alınmış olur. Farklı bir depoya göz atmak için, önce depo kaynağı olarak ayarlayın.
# 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
Kaynakların eşitlenmesini önlemek için:
steps:
- checkout: none
Not
Aracıyı Yerel Hizmet hesabında çalıştırıyorsanız ve git işlemlerini kullanarak veya git alt modüllerini yükleyerek geçerli depoyu değiştirmek istiyorsanız, Proje Koleksiyonu Derleme Hizmeti Hesapları kullanıcısına uygun izinleri verin.
- checkout: self
submodules: true
persistCredentials: true
İşlem hattınızdaki birden çok depoya göz atmak için birden çok checkout
adımı kullanın:
- checkout: self
- checkout: git://MyProject/MyRepo
- checkout: MyGitHubRepo # Repo declared in a repository resource
Daha fazla bilgi için bkz. İşlem hattıbirden çok depoya göz atın.