steps.checkout tanımı

İşlem hattının kaynak kodunu kullanıma nasıl kullandığını yapılandırmak için kullanın checkout .

steps:
- checkout: string # Required as first property. Configures checkout for the specified repository.
  clean: string # 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: string # 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: string # 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: string # 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: string # 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. , , nonedepo adı veya depo kaynağı belirtinself. Daha fazla bilgi için bkz. İşlem hattınızdaki birden çok depoya göz atın.

Not

Hiçbir checkout adım yoksa, varsayılan olarak self ve none için jobs.job.step.checkout olarak jobs.deployment.steps.checkoutayarlanır.

checkout Dize. İlk özellik olarak gereklidir.
Bu işlem hattı tanımını içeren deponun kullanıma alınıp alınmayacağı. veya nonebelirtinself.

clean Dize.
Doğruysa, getirmeden önce git clean -ffdx komutunu ve ardından git reset --hard HEAD komutunu çalıştırın. true | False.

fetchDepth Dize.
Getirilecek Git grafiğinin derinliği.

fetchTags Dize.
Depoyu getirirken etiketleri eşitlemek için 'true' veya etiketleri eşitlememek için 'false' olarak ayarlayın. Varsayılan davranış için açıklamalara bakın.

lfs Dize.
Git-LFS dosyalarını 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ği. Kök dizin $(Pipeline.Workspace) dizinidir.

condition Dize.
Bu görevin çalıştırılıp çalıştırılmayacağını belirlemek için bu koşul ifadesini değerlendirin.

continueOnErrorBoole değeri.
Hata durumunda bile çalışmaya devam mı edin?

displayName Dize.
Görevin insan tarafından okunabilen adı.

targethedef.
Bu görevin çalıştırıldığı ortam.

enabledBoole değeri.
İş çalıştırıldığında bu görev çalıştırılacak mı?

env dize sözlüğü.
İşlemin ortamına eşlenen değişkenler.

name Dize.
Adımın kimliği. Kabul edilebilir değerler: [-_A-Za-z0-9]*.

timeoutInMinutes Dize.
Sunucu 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 timeoutInMinutes bir aralıkla 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

Önemli

Eylül 2022 Azure DevOps sprint 209 güncelleştirmesinin ardından oluşturulan yeni işlem hatlarında 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ı arabirimindeSığ getirme ayarını görüntüleyin.

Sığ getirme özelliğini devre dışı bırakmak için aşağıdaki iki seçenekten birini gerçekleştirebilirsiniz.

İşlem hattının getirme derinliğini yapılandırmak için, adımında fetchDepthcheckout özelliğini ayarlayabilir veya işlem hattı ayarları kullanıcı arabirimindeSığ getirme ayarını yapılandırabilirsiniz.

Not

Adımınızda checkout açıkça ayarlarsanızfetchDepth, 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 Özellik 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 bu ayar varsayılan olarak true olarak ayarlanır. ile checkoutkullanılabilen 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'dekiçalışma alanı konusuna bakın.

Etiketleri eşitleme

Kullanıma alma adımı, --tags Git deposunun içeriğini getirirken 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 ekledi. Bu seçenek hem klasik hem de YAML işlem hatlarında kullanılabilir.

Bir depoyu kullanıma alırken etiketlerin eşitlenip eşitlenmeyeceği YAML'de özelliği ayarlanarak fetchTags ve kullanıcı arabiriminde Etiketleri eşitle ayarı yapılandırılarak yapılandırılabilir.

YAML'de ayarı yapılandırmak için özelliğini ayarlayın fetchTags .

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 eylemler, Tetikleyiciler, YAML, Kaynakları al'ı seçin ve Etiketleri eşitle onay kutusunu işaretleyin veya işaretini kaldırın. Daha fazla bilgi için bkz. Etiketleri eşitleme.

Varsayılan davranış

  • Eylül 2022'de yayımlanan Azure DevOps sprint 209 sürümünden önce oluşturulan mevcut işlem hatları için, etiketleri eşitlemek için varsayılan değer, Etiketleri eşitle seçenekleri eklenmeden önceki mevcut davranışla aynı kalır.true
  • Azure DevOps sprint 209 sürümünden sonra oluşturulan yeni işlem hatları için etiketleri eşitlemek için varsayılan değerdir false.

Önemli

Kullanıcı arabiriminde true olan Bir Eşitleme etiketleri ayarı YAML'deki bir fetchTags: false deyimden önceliklidir. Eşitleme etiketleri kullanıcı arabiriminde true olarak ayarlanırsa, YAML'de false olarak ayarlansa fetchTags bile etiketler eşitlenir.

Örnekler

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ınızdaki birden çok depoya göz atın.

Ayrıca bkz.