Nota
O acesso a esta página requer autorização. Pode tentar iniciar sessão ou alterar os diretórios.
O acesso a esta página requer autorização. Pode tentar alterar os diretórios.
A etapa bash
executa um script em 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.
Definições que fazem referência a esta definição: etapas
Propriedades
bash
string. Obrigatório como primeira propriedade.
Um script embutido.
failOnStderr
string.
Falhar a tarefa se a saída for enviada para Stderr?
workingDirectory
string.
Inicie o script com este diretório de trabalho.
condition
string.
Avalie essa expressão de condição para determinar se essa tarefa deve ser executada.
continueOnError
booleano.
Continuar a correr mesmo em caso de falha?
displayName
string.
Nome legível por humanos para a tarefa.
target
alvo.
Ambiente no qual executar esta tarefa.
enabled
booleano.
Executar esta tarefa quando o trabalho é executado?
env
dicionário de cordas.
Variáveis a serem mapeadas no ambiente do processo.
name
string.
ID da etapa. Valores aceitáveis: [-_A-Za-z0-9]*.
timeoutInMinutes
string.
Tempo para esperar que esta tarefa seja concluída antes que o servidor a mate.
Observação
Os pipelines podem ser configurados com um tempo limite de nível de trabalho. Se o intervalo de tempo limite do nível do trabalho decorrer antes da conclusão da etapa, o trabalho em execução (incluindo a etapa) será encerrado, mesmo que a etapa esteja configurada com um intervalo de timeoutInMinutes
maior. Para obter mais informações, consulte Tempos limite.
retryCountOnTaskFailure
string.
Número de novas tentativas se a tarefa falhar.
Observações
A palavra-chave bash
é um atalho para a tarefa shell script.
A tarefa executa um script em Bash no Windows, macOS e Linux.
Saiba mais sobre condições, tempos limitee etapas alvos.
Exemplos
steps:
- bash: |
which bash
echo Hello $name
displayName: Multiline Bash script
env:
name: Microsoft
Se você não especificar um modo de comando, poderá encurtar a estrutura target
para:
- bash:
target: string # container name or the word 'host'
Ver também
- tarefa de shell script
- Saiba mais sobre condições, tempos limitee etapas