Delen via


steps.bash definition

De bash stap voert een script uit in Bash in 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.

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.
het script starten met deze werkmap.

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

continueOnError booleaanse.
Doorgaan met uitvoeren, zelfs bij een fout?

displayName tekenreeks.
leesbare naam voor de taak.

target doel.
Omgeving waarin deze taak moet worden uitgevoerd.

enabled booleaanse.
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 doodt.

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-outsvoor meer informatie.

retryCountOnTaskFailure tekenreeks.
aantal nieuwe pogingen als de taak mislukt.

Opmerkingen

Het bash trefwoord is een snelkoppeling voor de shell-scripttaak. De taak voert een script uit in Bash in Windows, macOS en Linux.

Meer informatie over voorwaarden, time-outsen 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