Aracılığıyla paylaş


jobs.job tanımı

işi, aracısı veya sunucusutarafından çalıştırılan adımlardan oluşan bir koleksiyondur.

jobs:
- job: string # Required as first property. ID of the job.
  displayName: string # Human-readable name for the job.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this job.
  continueOnError: string # Continue running even on failure?
  timeoutInMinutes: string # Time to wait for this job to complete before the server kills it.
  cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it.
  variables: variables | [ variable ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | pool # Pool where this job will run.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
  workspace: # Workspace options on the agent.
    clean: outputs | resources | all # What to clean up before the job runs.
  uses: # Any resources required by this job that are not already referenced.
    repositories: [ string ] # Repository references.
    pools: [ string ] # Pool references.
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
  templateContext: # Job related information passed from a pipeline when extending a template.
jobs:
- job: string # Required as first property. ID of the job.
  displayName: string # Human-readable name for the job.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this job.
  continueOnError: string # Continue running even on failure?
  timeoutInMinutes: string # Time to wait for this job to complete before the server kills it.
  cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it.
  variables: variables | [ variable ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | pool # Pool where this job will run.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
  workspace: # Workspace options on the agent.
    clean: outputs | resources | all # What to clean up before the job runs.
  uses: # Any resources required by this job that are not already referenced.
    repositories: [ string ] # Repository references.
    pools: [ string ] # Pool references.
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
jobs:
- job: string # Required as first property. ID of the job.
  displayName: string # Human-readable name for the job.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this job.
  continueOnError: string # Continue running even on failure?
  timeoutInMinutes: string # Time to wait for this job to complete before the server kills it.
  cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it.
  variables: variables | [ variable ] # Job-specific variables.
  strategy: strategy # Execution strategy for this job.
  pool: string | pool # Pool where this job will run.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
  workspace: # Workspace options on the agent.
    clean: outputs | resources | all # What to clean up before the job runs.
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.

Bu tanıma başvuran tanımlar: işleri

Özellikler

job dize. İlk özellik olarak gereklidir.
İşin kimliği. Kabul edilebilir değerler: Geçerli adlar yalnızca alfasayısal karakterler ve '_' içerebilir ve bir sayı ile başlamıyor olabilir.

displayName dize.
iş için okunabilir bir ad.

dependsOn dizesi | dize listesi.
Bundan önce tamamlanması gereken tüm işler.

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

continueOnError dize.
Hata durumunda bile çalışmaya devam ?

timeoutInMinutes dize.
Sunucu işi sonlandırmadan önce bu işin tamamlanmasını bekleme süresi.

cancelTimeoutInMinutes dize.
zorla sonlandırmadan önce işin iptalini bekleme süresi.

değişkenleri variables.
İşe özgü değişkenleri .

jobs.job.strategystrategy.
bu iş için Yürütme stratejisini .

pool havuzu.
Bu işin çalıştırılacağı havuzu .

jobs.job.containercontainer.
Kapsayıcı kaynak adını .

dize sözlüğü services.
Kapsayıcı kaynaklarını hizmet kapsayıcısı olarak çalışacak şekilde .

çalışma alanınıworkspace.
Aracıda Çalışma Alanı seçeneklerini . Temiz seçenekler de dahil olmak üzere çalışma alanları hakkında daha fazla bilgi için, İşlerçalışma alanı konusuna bakın.

uses jobs.job.,kullanır.
İşlem hattının başka bir yerinde başvurulmayan, örneğin bir kullanıma alma adımı veya depo kaynağı gibi, bu işin gerektirdiği kaynakları belirtir. hakkında usesdaha fazla bilgi için bkz. Önceden bildirimde bulunurken iş yetkilendirme kapsamını sınırlama ve "uses" deyimi.

steps adımları.
Çalıştırılacak adımların listesi.

templateContext templateContext.
şablonu genişletirken işlem hattından geçirilen İşle ilgili bilgileri . Daha fazla bilgi için açıklamalar bölümüne bakın. templateContexthakkında daha fazla bilgi için bkz. Genişletilmiş YAML İşlem Hatları şablonları artık aşamalar, işler ve dağıtımlar için bağlam bilgileri geçirilebilir ve Şablonları -şablonlara özellik geçirmek için templateContext kullanma.

Açıklamalar

Varsayılan timeoutInMinutes 60 dakika olarak ayarlanır. Daha fazla bilgi için bkz. Zaman Aşımları.

İşler koşullu çalıştırabilir ve önceki işlere bağlı olabilir.

Uyarı

Yalnızca bir aşamanız ve bir işiniz varsa, çalıştırma adımlarını açıklamak için daha kısa bir yol olarak tek iş sözdizimi kullanabilirsiniz.

templateContexthakkında daha fazla bilgi için bkz. Genişletilmiş YAML İşlem Hatları şablonları artık aşamalar, işler ve dağıtımlar için bağlam bilgileri geçirilebilir ve Şablonları -şablonlara özellik geçirmek için templateContext kullanma.

Örnekler

jobs:
- job: MyJob
  displayName: My First Job
  continueOnError: true
  workspace:
    clean: outputs
  steps:
  - script: echo My first job

Ayrıca bkz.