Определение steps.script

На этом шаге script выполняется скрипт с помощью cmd.exe в Windows и Bash на других платформах.

steps:
- script: string # Required as first property. An inline script.
  failOnStderr: string # Fail the task if output is sent to Stderr?
  workingDirectory: string # Start the script with this working directory.
  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:
- script: string # Required as first property. An inline script.
  failOnStderr: string # Fail the task if output is sent to Stderr?
  workingDirectory: string # Start the script with this working directory.
  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:
- script: string # Required as first property. An inline script.
  failOnStderr: string # Fail the task if output is sent to Stderr?
  workingDirectory: string # Start the script with this working directory.
  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.

Определения, ссылающиеся на это определение: шаги

Свойства

script Строка. Требуется в качестве первого свойства.
Встроенный скрипт.

failOnStderr Строка.
Не удается выполнить задачу, если выходные данные отправляются в Stderr?

workingDirectory Строка.
Запустите скрипт с помощью этого рабочего каталога.

condition Строка.
Оцените это выражение условия, чтобы определить, следует ли выполнять эту задачу.

continueOnErrorлогическое значение.
Продолжить работу даже при сбое?

displayName Строка.
Понятное имя задачи.

targetцелевой объект.
Среда, в которой выполняется эта задача.

enabledлогическое значение.
Запускать эту задачу при выполнении задания?

env словарь строк.
Переменные для сопоставления со средой процесса.

name Строка.
Идентификатор шага. Допустимые значения: [-_A-Za-z0-9]*.

timeoutInMinutes Строка.
Время ожидания завершения этой задачи, прежде чем сервер завершит ее.

Примечание

Для конвейеров можно настроить время ожидания на уровне задания. Если интервал времени ожидания на уровне задания истекает до завершения шага, выполняемое задание (включая ваш шаг) завершается, даже если шаг настроен с более длительным timeoutInMinutes интервалом. Дополнительные сведения см. в разделе Время ожидания.

retryCountOnTaskFailure Строка.
Количество повторных попыток в случае сбоя задачи.

Комментарии

Ключевое слово script — это ярлык для задачи командной строки. Задача выполняет скрипт с помощью cmd.exe в Windows и Bash на других платформах.

Узнайте больше об условиях, времени ожидания и целевых показателяхшагов.

Примеры

Если режим команд не указан, можно сократить структуру до следующего target :

- script:
  target: string  # container name or the word 'host'
steps:
- script: echo Hello world!
  displayName: Say hello

См. также раздел