jobs.deployment.environment tanımı

environment anahtar sözcüğü, ortamı veya işlem hattının dağıtım işi tarafından hedeflenen kaynağını belirtir.

Bu tanıma başvuran tanımlar: jobs.deployment

Uygulamalar

Uygulama Açıklama
ortamı: dize Ortam adıyla dağıtım işi.
ortamı: name, resourceName, resourceId, resourceType, etiketler Tam denetim için tam söz dizimi.

Açıklamalar

Ortam, işin içinde tanımlanan adımları çalıştırmaya yönelik dağıtım stratejisi hakkında da bilgi içerir.

Dağıtım hedefinin kapsamını burada gösterildiği gibi ortamdaki belirli bir kaynakla azaltabilirsiniz:

environment: 'smarthotel-dev.bookings'
strategy:
  runOnce:
    deploy:
      steps:
      - task: KubernetesManifest@0
        displayName: Deploy to Kubernetes cluster
        inputs:
          action: deploy
          namespace: $(k8sNamespace)
          manifests: $(System.ArtifactsDirectory)/manifests/*
          imagePullSecrets: $(imagePullSecret)
          containers: $(containerRegistry)/$(imageRepository):$(tag)
          # value for kubernetesServiceConnection input automatically passed down to task by environment.resource input

environment: string

Ek özellikler kullanmadan bir ortamı ada göre belirtmek için aşağıdaki söz dizimini kullanın.

environment: string # Deployment job with environment name.

environment dize.

Ortam adıyla dağıtım işi.

Örnekler

environment: environmentName.resourceName
strategy:                 # deployment strategy
  runOnce:              # default strategy
    deploy:
      steps:
      - script: echo Hello world

environment: name, resourceName, resourceId, resourceType, tags

Ada ek olarak ortam özelliklerini yapılandırmak için tam söz dizimini kullanın.

environment:
  name: string # Name of environment.
  resourceName: string # Name of resource.
  resourceId: string # Id of resource.
  resourceType: string # Type of environment resource.
  tags: string # List of tag filters.

Özellikler

name dize.
Ortamın adı.

resourceName dize.
Kaynağın adı.

resourceId dize.
Kaynağın kimliği.

resourceType dize.
Ortam kaynağı türü.

tags dize.
etiket filtreleri listesini .

Örnekler

Söz diziminin tamamı şöyledir:

environment:            # create environment and/or record deployments
  name: string          # name of the environment to run this job on.
  resourceName: string  # name of the resource in the environment to record the deployments against
  resourceId: number    # resource identifier
  resourceType: string  # type of the resource you want to target. Supported types - virtualMachine, Kubernetes
  tags: string          # comma separated tag names to filter the resources in the environment
strategy:               # deployment strategy
  runOnce:              # default strategy
    deploy:
      steps:
      - script: echo Hello world

Bir ortamı veya kaynaklarından birini belirtirseniz ancak diğer özellikleri belirtmeniz gerekmiyorsa, söz dizimini şu şekilde kısaltabilirsiniz:

environment: environmentName.resourceName
strategy:         # deployment strategy
  runOnce:        # default strategy
    deploy:
      steps:
      - script: echo Hello world

Dağıtım hedefinin kapsamını burada gösterildiği gibi ortamdaki belirli bir kaynakla azaltabilirsiniz:

environment: 'smarthotel-dev.bookings'
strategy:
  runOnce:
    deploy:
      steps:
      - task: KubernetesManifest@0
        displayName: Deploy to Kubernetes cluster
        inputs:
          action: deploy
          namespace: $(k8sNamespace)
          manifests: $(System.ArtifactsDirectory)/manifests/*
          imagePullSecrets: $(imagePullSecret)
          containers: $(containerRegistry)/$(imageRepository):$(tag)
          # value for kubernetesServiceConnection input automatically passed down to task by environment.resource input

Ayrıca bkz.