steps.script definition

El script paso ejecuta un script mediante cmd.exe en Windows y Bash en otras plataformas.

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.

Definiciones que hacen referencia a esta definición: pasos

Propiedades

script Cadena. Obligatorio como primera propiedad.
Un script insertado.

failOnStderr Cadena.
¿Produce un error en la tarea si la salida se envía a Stderr?

workingDirectory Cadena.
Inicie el script con este directorio de trabajo.

condition Cadena.
Evalúe esta expresión de condición para determinar si se va a ejecutar esta tarea.

continueOnErrorbooleano.
¿Sigue ejecutándose incluso en caso de error?

displayName Cadena.
Nombre legible para la tarea.

targettarget.
Entorno en el que se va a ejecutar esta tarea.

enabledbooleano.
¿Ejecuta esta tarea cuando se ejecuta el trabajo?

env diccionario de cadenas.
Variables que se van a asignar al entorno del proceso.

name Cadena.
Identificador del paso. Valores aceptables: [-_A-Za-z0-9]*.

timeoutInMinutes Cadena.
Tiempo de espera para que esta tarea se complete antes de que el servidor la mate.

Nota

Las canalizaciones se pueden configurar con un tiempo de espera de nivel de trabajo. Si el intervalo de tiempo de espera de nivel de trabajo transcurre antes de que se complete el paso, se finaliza el trabajo en ejecución (incluido el paso), incluso si el paso está configurado con un intervalo más largo timeoutInMinutes . Para obtener más información, consulte Tiempos de espera.

retryCountOnTaskFailure Cadena.
Número de reintentos si se produce un error en la tarea.

Observaciones

La palabra clave script es un método abreviado de la tarea de línea de comandos. La tarea ejecuta un script mediante cmd.exe en Windows y Bash en otras plataformas.

Obtenga más información sobre las condiciones, los tiempos de espera y los destinos de paso.

Ejemplos

Si no especifica un modo de comando, puede acortar la estructura target a:

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

Consulte también