تعريف steps.checkout

استخدم checkout لتكوين كيفية فحص البنية الأساسية لبرنامج ربط العمليات التجارية من التعليمات البرمجية المصدر.

steps:
- checkout: string # Required as first property. Configures checkout for the specified repository.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  fetchTags: string # Set to 'true' to sync tags when fetching the repo, or 'false' to not sync tags. See remarks for the default behavior.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
  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:
- checkout: string # Required as first property. Configures checkout for the specified repository.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
  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:
- checkout: string # Required as first property. Configures checkout for the specified repository.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
  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:
- checkout: string # Required as first property. Whether or not to check out the repository containing this pipeline definition.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  path: string # Where to put the repository. The root directory is $(Pipeline.Workspace).
  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.
steps:
- checkout: string # Required as first property. Whether or not to check out the repository containing this pipeline definition.
  clean: string # If true, run git clean -ffdx followed by git reset --hard HEAD before fetching.
  fetchDepth: string # Depth of Git graph to fetch.
  lfs: string # Set to 'true' to download Git-LFS files. Default is not to download them.
  persistCredentials: string # Set to 'true' to leave the OAuth token in the Git config after the initial fetch. The default is not to leave it.
  submodules: string # Set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules. Default is not to fetch submodules.
  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.

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

الخصائص

checkout سلسله. مطلوب كخاصية أولى.
تكوين السحب للمستودع المحدد. حدد selfأو noneأو اسم المستودع أو مورد المستودع. لمزيد من المعلومات، راجع التحقق من مستودعات متعددة في البنية الأساسية لبرنامج ربط العمليات التجارية الخاصة بك.

ملاحظة

إذا لم تكن هناك checkout خطوة موجودة، فسيتم تعيينها افتراضيا إلى self ل jobs.job.step.checkout وnone.jobs.deployment.steps.checkout

checkout سلسله. مطلوب كخاصية أولى.
ما إذا كان يجب التحقق من المستودع الذي يحتوي على تعريف البنية الأساسية لبرنامج ربط العمليات التجارية هذا أم لا. حدد self أو none.

clean سلسله.
إذا كان صحيحا، فقم بتشغيل git clean -ffdx متبوعا بإعادة تعيين git --hard HEAD قبل الجلب. صحيح | كاذبه.

fetchDepth سلسله.
عمق الرسم البياني Git لجلبه.

fetchTags سلسله.
اضبط على "صحيح" لمزامنة العلامات عند إحضار المستودع، أو "خطأ" لعدم مزامنة العلامات. راجع ملاحظات حول السلوك الافتراضي.

lfs سلسله.
اضبط على "true" لتنزيل ملفات Git-LFS. الافتراضي هو عدم تنزيلها.

persistCredentials سلسله.
اضبط على "true" لترك رمز OAuth المميز في تكوين Git بعد الجلب الأولي. الافتراضي هو عدم تركه.

submodules سلسله.
اضبط على "صحيح" لمستوى واحد من الوحدات الفرعية أو "المتكررة" للحصول على قوالب فرعية من الوحدات الفرعية. الافتراضي هو عدم إحضار الوحدات الفرعية.

path سلسله.
مكان وضع المستودع. الدليل الجذر هو $(Pipeline.Workspace).

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

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

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

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

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

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

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

timeoutInMinutes سلسله.
حان الوقت للانتظار حتى تكتمل هذه المهمة قبل أن يقتلها الخادم.

ملاحظة

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

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

الملاحظات

إحضار سطحي

هام

تم تمكين التدفقات الجديدة التي تم إنشاؤها بعد تحديث دورة Azure DevOps المتكررة 209 لشهر سبتمبر 2022 بشكل افتراضي وتكوينها بعمق 1. في السابق لم يكن الافتراضي هو الجلب الضحل. للتحقق من البنية الأساسية لبرنامج ربط العمليات التجارية الخاصة بك، اعرض إعداد الجلب الضحل في واجهة مستخدم إعدادات البنية الأساسية لبرنامج ربط العمليات التجارية.

لتعطيل الجلب الضحل، يمكنك تنفيذ أحد الخيارين التاليين.

لتكوين عمق الجلب للبنية الأساسية لبرنامج ربط العمليات التجارية، يمكنك إما تعيين الخاصية fetchDepth في checkout الخطوة، أو تكوين إعداد الجلب الضحل في واجهة مستخدم إعدادات البنية الأساسية لبرنامج ربط العمليات التجارية.

ملاحظة

إذا قمت بتعيين fetchDepth بشكل صريح في خطوتك checkout ، فإن هذا الإعداد يأخذ الأولوية على الإعداد الذي تم تكوينه في واجهة مستخدم إعدادات البنية الأساسية لبرنامج ربط العمليات التجارية. يجلب الإعداد fetchDepth: 0 جميع المحفوظات ويتجاوز إعداد الجلب الضحل .

تنظيف الخاصية

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

مزامنة العلامات

تستخدم --tags خطوة الخروج الخيار عند إحضار محتويات مستودع Git. يؤدي هذا إلى إحضار الخادم لجميع العلامات بالإضافة إلى جميع الكائنات التي تشير إليها تلك العلامات. يؤدي ذلك إلى زيادة وقت تشغيل المهمة في البنية الأساسية لبرنامج ربط العمليات التجارية، خاصة إذا كان لديك مستودع كبير مع عدد من العلامات. علاوة على ذلك، تقوم خطوة الخروج بمزامنة العلامات حتى عند تمكين خيار الجلب الضحل، وبالتالي ربما هزيمة الغرض منه. لتقليل كمية البيانات التي تم جلبها أو سحبها من مستودع Git، أضافت Microsoft خيارا جديدا للسحب للتحكم في سلوك مزامنة العلامات. يتوفر هذا الخيار في كل من البنية الأساسية لبرنامج ربط العمليات التجارية الكلاسيكية و YAML.

يمكن تكوين ما إذا كنت تريد مزامنة العلامات عند سحب مستودع في YAML عن طريق تعيين fetchTags الخاصية، وفي واجهة المستخدم عن طريق تكوين إعداد علامات المزامنة .

لتكوين الإعداد في YAML، قم بتعيين الخاصية fetchTags .

steps:
- checkout: self
  fetchTags: true

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

السلوك الافتراضي

  • بالنسبة للبنية الأساسية لبرنامج ربط العمليات التجارية الموجودة التي تم إنشاؤها قبل إصدار دورة Azure DevOps المتكررة 209، التي تم إصدارها في سبتمبر 2022، يظل الافتراضي لمزامنة العلامات هو نفسه السلوك الحالي قبل إضافة خيارات علامات المزامنة ، وهو true.
  • بالنسبة للبنية الأساسية لبرنامج ربط العمليات التجارية الجديدة التي تم إنشاؤها بعد الإصدار المتكرر من Azure DevOps 209، يكون الافتراضي لمزامنة العلامات هو false.

هام

يكون لإعداد علامات المزامنة true في واجهة المستخدم الأسبقية على عبارة fetchTags: false في YAML. إذا تم تعيين علامات المزامنة إلى true في واجهة المستخدم، تتم مزامنة العلامات حتى إذا fetchTags تم تعيينها على false في YAML.

أمثلة

لتجنب مزامنة المصادر على الإطلاق:

steps:
- checkout: none

ملاحظة

إذا كنت تقوم بتشغيل العامل في حساب الخدمة المحلية وتريد تعديل المستودع الحالي باستخدام عمليات git أو تحميل وحدات git الفرعية، فامنح الأذونات المناسبة لمستخدم Project Collection Build Service Accounts.

- checkout: self
  submodules: true
  persistCredentials: true

للتحقق من مستودعات متعددة في البنية الأساسية لبرنامج ربط العمليات التجارية الخاصة بك، استخدم خطوات متعددة checkout :

- checkout: self
- checkout: git://MyProject/MyRepo
- checkout: MyGitHubRepo # Repo declared in a repository resource

لمزيد من المعلومات، راجع التحقق من مستودعات متعددة في البنية الأساسية لبرنامج ربط العمليات التجارية الخاصة بك.

راجع أيضًا