تعريف steps.task

تقوم task الخطوة بتشغيل مهمة.

تدعم جميع المهام المجموعة التالية من الخصائص الشائعة.

steps:
- task: string # Required as first property. Name of the task to run.
  inputs: # Inputs for the task.
    string: string # Name/value pairs
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  target: string | target # Environment in which to run this task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
  retryCountOnTaskFailure: string # Number of retries if the task fails.
steps:
- task: string # Required as first property. Name of the task to run.
  inputs: # Inputs for the task.
    string: string # Name/value pairs
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  target: string | target # Environment in which to run this task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.
steps:
- task: string # Required as first property. Name of the task to run.
  inputs: # Inputs for the task.
    string: string # Name/value pairs
  condition: string # Evaluate this condition expression to determine whether to run this task.
  continueOnError: boolean # Continue running even on failure?
  displayName: string # Human-readable name for the task.
  enabled: boolean # Run this task when the job runs?
  env: # Variables to map into the process's environment.
    string: string # Name/value pairs
  name: string # ID of the step.
  timeoutInMinutes: string # Time to wait for this task to complete before the server kills it.

التعريفات التي تشير إلى هذا التعريف: الخطوات

الخصائص

task سلسله. مطلوب كخاصية أولى.
اسم المهمة المراد تشغيلها.

inputs قاموس السلسلة.
مدخلات للمهمة.

condition سلسله.
قم بتقييم تعبير الشرط هذا لتحديد ما إذا كان سيتم تشغيل هذه المهمة أم لا.

continueOnErrorمنطقية.
هل تستمر في التشغيل حتى عند الفشل؟

displayName سلسله.
اسم يمكن للبشر قراءته للمهمة.

targetالهدف.
البيئة التي سيتم فيها تشغيل هذه المهمة.

enabledمنطقية.
هل تقوم بتشغيل هذه المهمة عند تشغيل المهمة؟

env قاموس السلسلة.
المتغيرات المراد تعيينها في بيئة العملية.

name سلسله.
معرف الخطوة. القيم المقبولة: [-_A-Za-z0-9]*.

timeoutInMinutes سلسله.
حان الوقت للانتظار حتى تكتمل هذه المهمة قبل أن يقتلها الخادم. على سبيل المثال، لتكوين مهلة 10 دقائق، استخدم timeoutInMinutes: 10.

ملاحظة

قد يتم تكوين المسارات مع مهلة مستوى الوظيفة. إذا انقضى الفاصل الزمني لمهلة مستوى الوظيفة قبل اكتمال خطوتك، يتم إنهاء المهمة قيد التشغيل (بما في ذلك خطوتك)، حتى إذا تم تكوين الخطوة بفاصل زمني أطول timeoutInMinutes . لمزيد من المعلومات، راجع المهلات.

retryCountOnTaskFailure سلسله.
عدد عمليات إعادة المحاولة إذا فشلت المهمة.

الملاحظات

المهام هي اللبنات الأساسية للبنية الأساسية لبرنامج ربط العمليات التجارية. هناك كتالوج للمهام المتاحة للاختيار من بينها.

إذا لم تحدد وضع أمر، يمكنك تقصير target البنية إلى:

- task:
  target: string  # container name or the word 'host'

خصائص المهمة الشائعة

تدعم جميع المهام مجموعة من الخصائص الشائعة بالإضافة إلى name و inputs. للحصول على قائمة بخصائص المهمة الشائعة، راجع قسم الخصائص السابق. لمزيد من المعلومات حول تكوين هذه الخصائص، راجع خيارات التحكم بالمهمةومتغيرات بيئة المهمة.

تعرف على المزيد حول الشروطوالمهلاتوأهداف الخطوة.

أمثلة

steps:
- task: VSBuild@1
  displayName: Build
  timeoutInMinutes: 120
  inputs:
    solution: '**\*.sln'

راجع أيضًا