Compartir a través de


definición de steps.script

El paso script 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.

Definiciones que hacen referencia a esta definición: pasos

Propiedades

script cadena. Obligatorio como primera propiedad.
un script insertado.

failOnStderr cadena.
Error en la tarea si la salida se envía a Stderr?

workingDirectory cadena.
Iniciar el script con este directorio de trabajo.

condition cadena.
Evaluar esta expresión de condición para determinar si se debe ejecutar esta tarea.

continueOnError booleano .
Continuar ejecutándose incluso en caso de error?

displayName cadena.
nombre legible para la tarea.

target de destino .
entorno en el que se va a ejecutar esta tarea.

enabled booleano .
Ejecutar 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 se complete esta tarea antes de que el servidor lo mate.

Nota:

Las canalizaciones se pueden configurar con un tiempo de espera de nivel de trabajo. Si el intervalo de tiempo de espera del 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 de timeoutInMinutes más largo. Para obtener más información, vea Tiempos de espera.

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

Observaciones

La palabra clave script es un acceso directo para 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 de , los tiempos de espera y los destinos de paso de .

Ejemplos

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

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

Consulte también

  • de tareas de línea de comandos