Определение steps.bash
На шаге bash
выполняется сценарий в Bash в Windows, macOS и Linux.
steps:
- bash: 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:
- bash: 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.
Определения, ссылающиеся на это определение: шаги
Свойства
строка bash
. Обязательный в качестве первого свойства.
встроенный скрипт.
строка failOnStderr
.
сбой задачи, если выходные данные отправляются в Stderr?
строка workingDirectory
.
Запустите скрипт с помощью этого рабочего каталога.
строка condition
.
оценить это выражение условия, чтобы определить, следует ли выполнять эту задачу.
continueOnError
логические.
Продолжить работу даже при сбое?
строка displayName
.
имя, доступное для чтения для задачи.
target
целевой.
среда, в которой выполняется эта задача.
enabled
логические.
запустить эту задачу при выполнении задания?
env
словарь строк.
Переменные для сопоставления с средой процесса.
строка name
.
идентификатор шага. Допустимые значения: [-_A-Za-z0-9]*.
строка timeoutInMinutes
.
время ожидания завершения этой задачи до того, как сервер убьет его.
Примечание.
Конвейеры могут быть настроены с временем ожидания уровня задания. Если интервал времени ожидания задания истекает до завершения шага, выполнение задания (включая шаг) завершается, даже если шаг настроен с более длинным интервалом timeoutInMinutes
. Дополнительные сведения см. в разделе "Время ожидания".
строка retryCountOnTaskFailure
.
число повторных попыток, если задача завершается ошибкой.
Замечания
Ключевое слово bash
— это ярлык для задачи скрипта оболочки.
Задача выполняет скрипт в Bash в Windows, macOS и Linux.
Узнайте больше о условиях, времени ожиданияи целевых объектов.
Примеры
steps:
- bash: |
which bash
echo Hello $name
displayName: Multiline Bash script
env:
name: Microsoft
Если вы не указываете режим команд, можно сократить структуру target
до следующего:
- bash:
target: string # container name or the word 'host'
См. также
- задачи скрипта оболочки
- Дополнительные сведения об условиях , времени ожиданияи целевых объектов