steps.bash-definitie

Met de bash stap wordt een script uitgevoerd in Bash op Windows, macOS en 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.
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.

Definities die naar deze definitie verwijzen: stappen

Eigenschappen

bash Tekenreeks. Vereist als eerste eigenschap.
Een inlinescript.

failOnStderr Tekenreeks.
Mislukt de taak als uitvoer naar Stderr wordt verzonden?

workingDirectory Tekenreeks.
Start het script met deze werkmap.

condition Tekenreeks.
Evalueer deze voorwaardeexpressie om te bepalen of deze taak moet worden uitgevoerd.

continueOnErrorbooleaanse waarde.
Doorgaan met uitvoeren, zelfs bij een fout?

displayName Tekenreeks.
Door mensen leesbare naam voor de taak.

targetdoel.
Omgeving waarin deze taak moet worden uitgevoerd.

enabledbooleaanse waarde.
Deze taak uitvoeren wanneer de taak wordt uitgevoerd?

env tekenreekswoordenlijst.
Variabelen die moeten worden toegewezen aan de omgeving van het proces.

name Tekenreeks.
Id van de stap. Acceptabele waarden: [-_A-Za-z0-9]*.

timeoutInMinutes Tekenreeks.
Tijd om te wachten tot deze taak is voltooid voordat de server deze beëindigt.

Notitie

Pijplijnen kunnen worden geconfigureerd met een time-out op taakniveau. Als het time-outinterval op taakniveau is verstreken voordat de stap is voltooid, wordt de actieve taak (inclusief uw stap) beëindigd, zelfs als de stap is geconfigureerd met een langer timeoutInMinutes interval. Zie Time-outs voor meer informatie.

retryCountOnTaskFailure Tekenreeks.
Aantal nieuwe pogingen als de taak mislukt.

Opmerkingen

Het bash trefwoord is een snelkoppeling voor de shellscripttaak. Met de taak wordt een script uitgevoerd in Bash op Windows, macOS en Linux.

Meer informatie over voorwaarden, time-outs en stapdoelen.

Voorbeelden

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

Als u geen opdrachtmodus opgeeft, kunt u de target structuur verkorten tot:

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

Zie ook