Bagikan melalui


definisi jobs.job

Pekerjaan adalah kumpulan langkah yang dijalankan oleh agen atau di server.

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: string # Which parts of the workspace should be scorched before fetching.
  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: string # Which parts of the workspace should be scorched before fetching.
  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: string # Which parts of the workspace should be scorched before fetching.
  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: string # Scorch the repo before fetching?
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | publish | template ] # 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.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
  workspace: # Workspace options on the agent.
    clean: string # Scorch the repo before fetching?
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | publish | template ] # A list of steps to run.

Definisi yang mereferensikan definisi ini: pekerjaan

Properti

job String. Diperlukan sebagai properti pertama.
ID pekerjaan. Nilai yang dapat diterima: Nama yang valid hanya boleh berisi karakter alfanumerik dan '_' dan mungkin tidak dimulai dengan angka.

displayName String.
Nama yang bisa dibaca manusia untuk pekerjaan itu.

dependsOn string | daftar string.
Pekerjaan apa pun yang harus diselesaikan sebelum pekerjaan ini.

condition String.
Evaluasi ekspresi kondisi ini untuk menentukan apakah akan menjalankan pekerjaan ini.

continueOnError String.
Terus berjalan bahkan pada kegagalan?

timeoutInMinutes String.
Waktu untuk menunggu pekerjaan ini selesai sebelum server mematikannya.

cancelTimeoutInMinutes String.
Waktu untuk menunggu pekerjaan dibatalkan sebelum mengakhirinya secara paksa.

variablesvariabel.
Variabel khusus pekerjaan.

strategyjobs.job.strategy.
Strategi eksekusi untuk pekerjaan ini.

poolkolam renang.
Kumpulan tempat pekerjaan ini akan berjalan.

containerjobs.job.container.
Nama sumber daya kontainer.

services kamus string.
Sumber daya kontainer untuk dijalankan sebagai kontainer layanan.

workspaceruang kerja.
Opsi ruang kerja pada agen. Untuk informasi selengkapnya tentang ruang kerja, termasuk opsi bersih, lihat topik ruang kerja di Pekerjaan.

usesjobs.job.uses.
Sumber daya apa pun yang diperlukan oleh pekerjaan ini yang belum dirujuk. Untuk informasi selengkapnya tentang uses, lihat Membatasi cakupan otorisasi pekerjaan ke repositori Azure DevOps yang direferensikan.

stepslangkah-langkah.
Daftar langkah-langkah yang akan dijalankan.

templateContext templateContext.
Informasi terkait pekerjaan yang diteruskan dari alur saat memperluas templat. Lihat keterangan untuk informasi selengkapnya. Untuk informasi selengkapnya tentang templateContext, lihat Templat Alur YAML yang Diperluas sekarang dapat diteruskan informasi konteks untuk tahapan, pekerjaan, dan penyebaran dan Templat - Gunakan templateContext untuk meneruskan properti ke templat.

Keterangan

Defaultnya timeoutInMinutes diatur ke 60 menit. Untuk informasi selengkapnya, lihat Batas Waktu.

Pekerjaan dapat berjalan secara kondisional dan mungkin bergantung pada pekerjaan sebelumnya.

Catatan

Jika Anda hanya memiliki satu tahap dan satu pekerjaan, Anda dapat menggunakan sintaks pekerjaan tunggal sebagai cara yang lebih singkat untuk menjelaskan langkah-langkah yang akan dijalankan.

Contoh

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

Lihat juga