Share via


steps.bash definition

O bash passo executa um script no Bash no Windows, macOS e 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.

Definições que referenciam esta definição: passos

Propriedades

bash cadeia. Necessário como primeira propriedade.
Um script inline.

failOnStderr cadeia.
Falha na tarefa se a saída for enviada para Stderr?

workingDirectory cadeia.
Inicie o script com este diretório de trabalho.

condition cadeia.
Avalie esta expressão de condição para determinar se deve executar esta tarefa.

continueOnErrorbooleano.
Continuar a executar mesmo com falhas?

displayName cadeia.
Nome legível por humanos para a tarefa.

targetdestino.
Ambiente para executar esta tarefa.

enabledbooleano.
Executar esta tarefa quando a tarefa for executada?

env dicionário de cadeias.
Variáveis a mapear para o ambiente do processo.

name cadeia.
ID do passo. Valores aceitáveis: [-_A-Za-z0-9]*.

timeoutInMinutes cadeia.
Hora de aguardar que esta tarefa seja concluída antes que o servidor a mate.

Nota

Os pipelines podem ser configurados com um tempo limite ao nível da tarefa. Se o intervalo de tempo limite do nível da tarefa decorrido antes da conclusão do passo, a tarefa de execução (incluindo o passo) será terminada, mesmo que o passo esteja configurado com um intervalo mais longo timeoutInMinutes . Para obter mais informações, veja Tempos Limite.

retryCountOnTaskFailure cadeia.
Número de tentativas se a tarefa falhar.

Observações

A bash palavra-chave é um atalho para a tarefa de script da shell. A tarefa executa um script no Bash no Windows, macOS e Linux.

Saiba mais sobre condições, tempos limite e destinos de passo.

Exemplos

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

Se não especificar um modo de comando, pode encurtar a target estrutura para:

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

Ver também