definice steps.bash

Krok bash spustí skript v Bashu ve Windows, macOS a Linuxu.

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.
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.
  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.

Definice, které odkazují na tuto definici: kroky

Vlastnosti

bash Řetězec. Povinný argument jako první vlastnost.
Vložený skript.

failOnStderr Řetězec.
Pokud se výstup odešle do Stderru, úloha se nezdaří?

workingDirectory Řetězec.
Spusťte skript s tímto pracovním adresářem.

condition Řetězec.
Vyhodnoťte tento výraz podmínky a určete, jestli se má tato úloha spustit.

continueOnErrorboolean.
Chcete pokračovat v provozu i při selhání?

displayName Řetězec.
Název úkolu čitelný pro člověka.

targetcíl.
Prostředí, ve kterém se má tato úloha spustit.

enabledboolean.
Spustit tuto úlohu při spuštění úlohy?

env řetězcový slovník.
Proměnné, které se mají mapovat na prostředí procesu.

name Řetězec.
ID kroku. Přijatelné hodnoty: [-_A-Za-z0-9]*.

timeoutInMinutes Řetězec.
Je čas počkat na dokončení této úlohy, než ho server ukončí.

Poznámka

Kanály mohou být nakonfigurované s vypršením časového limitu na úrovni úlohy. Pokud interval časového limitu na úrovni úlohy uplynou před dokončením kroku, spuštěná úloha (včetně vašeho kroku) se ukončí, a to i v případě, že je krok nakonfigurovaný s delším timeoutInMinutes intervalem. Další informace najdete v tématu Vypršení časových limitů.

retryCountOnTaskFailure Řetězec.
Počet opakování v případě selhání úkolu

Poznámky

Klíčové bash slovo je zástupce pro úlohu skriptu prostředí. Úloha spustí skript v Bashu ve Windows, macOS a Linuxu.

Přečtěte si další informace o podmínkách, časových limitech a cílech kroků.

Příklady

steps:
- bash: |
    which bash
    echo Hello $name
  displayName: Multiline Bash script
  env:
    name: Microsoft

Pokud nezadáte režim příkazů, můžete strukturu zkrátit target na:

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

Viz také