steps.task definition

Krok task uruchamia zadanie.

Wszystkie zadania obsługują następujący zestaw typowych właściwości.

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.

Definicje odwołujące się do tej definicji: kroki

Właściwości

task Ciąg. Wymagane jako pierwsza właściwość.
Nazwa zadania do uruchomienia.

inputs słownik ciągów.
Dane wejściowe zadania.

condition Ciąg.
Oceń to wyrażenie warunku, aby określić, czy należy uruchomić to zadanie.

continueOnErrorwartość logiczna.
Czy kontynuować działanie nawet w przypadku awarii?

displayName Ciąg.
Czytelna dla człowieka nazwa zadania.

targetelement docelowy.
Środowisko, w którym ma zostać uruchomione to zadanie.

enabledwartość logiczna.
Czy uruchamiać to zadanie po uruchomieniu zadania?

env słownik ciągów.
Zmienne do mapowania na środowisko procesu.

name Ciąg.
Identyfikator kroku. Dopuszczalne wartości: [-_A-Za-z0-9]*.

timeoutInMinutes Ciąg.
Czas oczekiwania na ukończenie tego zadania, zanim serwer go zabije. Aby na przykład skonfigurować limit czasu 10 minut, użyj polecenia timeoutInMinutes: 10.

Uwaga

Potoki można skonfigurować przy użyciu limitu czasu na poziomie zadania. Jeśli interwał limitu czasu na poziomie zadania upłynął przed ukończeniem kroku, zadanie uruchomione (w tym krok) zostanie zakończone, nawet jeśli krok zostanie skonfigurowany z dłuższym timeoutInMinutes interwałem. Aby uzyskać więcej informacji, zobacz Limity czasu.

retryCountOnTaskFailure Ciąg.
Liczba ponownych prób w przypadku niepowodzenia zadania.

Uwagi

Zadania to bloki konstrukcyjne potoku. Dostępny jest wykaz zadań do wyboru.

Jeśli nie określisz trybu polecenia, możesz skrócić target strukturę do:

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

Typowe właściwości zadania

Wszystkie zadania obsługują zestaw typowych właściwości oprócz name i inputs. Aby uzyskać listę typowych właściwości zadań, zobacz poprzednią sekcję Właściwości . Aby uzyskać więcej informacji na temat konfigurowania tych właściwości, zobacz Opcje sterowania zadaniami i Zmienne środowiskowe zadania.

Dowiedz się więcej na temat warunków, limitów czasu i celów kroków.

Przykłady

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

Zobacz też