تعريف jobs.deployment
مهمة التوزيع هي نوع خاص من الوظائف. إنها مجموعة من الخطوات للتشغيل بالتتابع مقابل البيئة.
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
التعريفات التي تشير إلى هذا التعريف: الوظائف
الخصائص
deployment
سلسله. مطلوب كخاصية أولى.
اسم مهمة التوزيع، A-Z، a-z، 0-9، والتسطير السفلي. الكلمة deploy هي كلمة أساسية وغير مدعومة كاسم نشر.
displayName
سلسله.
اسم قابل للقراءة البشرية للنشر.
dependsOn
سلسلة | قائمة السلاسل.
أي وظائف يجب أن تكتمل قبل هذه المهمة.
condition
سلسله.
قم بتقييم تعبير الشرط هذا لتحديد ما إذا كان سيتم تشغيل هذا التوزيع.
continueOnError
سلسله.
هل تستمر في التشغيل حتى عند الفشل؟
timeoutInMinutes
سلسله.
حان الوقت للانتظار حتى تكتمل هذه المهمة قبل أن يقتلها الخادم.
cancelTimeoutInMinutes
سلسله.
حان الوقت لانتظار إلغاء المهمة قبل إنهائها قسرا.
variables
المتغيرات.
المتغيرات الخاصة بالنشر.
pool
تجمع.
تجمع حيث سيتم تشغيل هذه المهمة.
environment
jobs.deployment.environment.
اسم البيئة الهدف واسم مورد اختياريا لتسجيل محفوظات التوزيع؛ format: environment-name.resource-name.
strategy
jobs.deployment.strategy.
استراتيجية التنفيذ لهذا النشر.
workspace
مساحة العمل.
خيارات مساحة العمل على العامل.
uses
jobs.job.uses.
أي موارد مطلوبة من قبل هذه الوظيفة لم تتم الإشارة إليها بالفعل.
container
jobs.job.container.
اسم مورد الحاوية.
services
قاموس السلسلة.
موارد الحاوية لتشغيلها كحاوية خدمة.
templateContext
templateContext.
تم تمرير المعلومات المتعلقة بالتنشر من البنية الأساسية لبرنامج ربط العمليات التجارية عند توسيع قالب. راجع الملاحظات لمزيد من المعلومات. لمزيد من المعلومات حول templateContext
، راجع يمكن الآن تمرير قوالب مسارات YAML الموسعة معلومات السياق للمراحل والوظائف وعمليات التوزيعوالقوالب - استخدم templateContext لتمرير الخصائص إلى القوالب.
الملاحظات
في مسارات YAML، يوصي فريق البنية الأساسية لبرنامج ربط العمليات التجارية بوضع خطوات التوزيع في مهمة توزيع.
لمزيد من المعلومات حول templateContext
، راجع يمكن الآن تمرير قوالب مسارات YAML الموسعة معلومات السياق للمراحل والوظائف وعمليات التوزيعوالقوالب - استخدم templateContext لتمرير الخصائص إلى القوالب.
أمثلة
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