definisi jobs.deployment

Pekerjaan penyebaran adalah jenis pekerjaan khusus. Ini adalah kumpulan langkah-langkah untuk berjalan secara berurutan terhadap lingkungan.

jobs:
- deployment: string # Required as first property. Name of the deployment job, A-Z, a-z, 0-9, and underscore. The word deploy is a keyword and is unsupported as the deployment name.
  displayName: string # Human-readable name for the deployment.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this deployment.
  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 ] # Deployment-specific variables.
  pool: string | pool # Pool where this job will run.
  environment: string | environment # Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.
  strategy: strategy # Execution strategy for this deployment.
  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.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
  templateContext: # Deployment related information passed from a pipeline when extending a template.
jobs:
- deployment: string # Required as first property. Name of the deployment job, A-Z, a-z, 0-9, and underscore. The word deploy is a keyword and is unsupported as the deployment name.
  displayName: string # Human-readable name for the deployment.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this deployment.
  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 ] # Deployment-specific variables.
  pool: string | pool # Pool where this job will run.
  environment: string | environment # Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.
  strategy: strategy # Execution strategy for this deployment.
  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.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs
jobs:
- deployment: string # Required as first property. Name of the deployment job, A-Z, a-z, 0-9, and underscore. The word deploy is a keyword and is unsupported as the deployment name.
  displayName: string # Human-readable name for the deployment.
  dependsOn: string | [ string ] # Any jobs which must complete before this one.
  condition: string # Evaluate this condition expression to determine whether to run this deployment.
  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 ] # Deployment-specific variables.
  pool: string | pool # Pool where this job will run.
  environment: string | environment # Target environment name and optionally a resource name to record the deployment history; format: environment-name.resource-name.
  strategy: strategy # Execution strategy for this deployment.
  workspace: # Workspace options on the agent.
    clean: string # Which parts of the workspace should be scorched before fetching.
  container: string | container # Container resource name.
  services: # Container resources to run as a service container.
    string: string # Name/value pairs

Definisi yang mereferensikan definisi ini: pekerjaan

Properti

deployment String. Diperlukan sebagai properti pertama.
Nama pekerjaan penyebaran, A-Z, a-z, 0-9, dan garis bawah. Kata deploy adalah kata kunci dan tidak didukung sebagai nama penyebaran.

displayName String.
Nama yang dapat dibaca manusia untuk penyebaran.

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

condition String.
Evaluasi ekspresi kondisi ini untuk menentukan apakah akan menjalankan penyebaran 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 penyebaran.

poolkolam renang.
Kumpulan tempat pekerjaan ini akan berjalan.

environmentjobs.deployment.environment.
Nama lingkungan target dan secara opsional nama sumber daya untuk merekam riwayat penyebaran; format: environment-name.resource-name.

strategyjobs.deployment.strategy.
Strategi eksekusi untuk penyebaran ini.

workspaceruang kerja.
Opsi ruang kerja pada agen.

usesjobs.job.uses.
Sumber daya apa pun yang diperlukan oleh pekerjaan ini yang belum dirujuk.

containerjobs.job.container.
Nama sumber daya kontainer.

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

templateContext templateContext.
Informasi terkait penyebaran 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

Dalam alur YAML, tim alur merekomendasikan agar Anda menempatkan langkah-langkah penyebaran Anda dalam pekerjaan penyebaran.

Contoh

jobs:
  # track deployments on the environment
- deployment: DeployWeb
  displayName: deploy Web App
  pool:
    vmImage: ubuntu-latest
  # creates an environment if it doesn't exist
  environment: 'smarthotel-dev'
  strategy:
    # default deployment strategy, more coming...
    runOnce:
      deploy:
        steps:
        - script: echo my first deployment