definisi steps.script

Langkah ini script menjalankan skrip menggunakan cmd.exe di Windows dan Bash pada platform lain.

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.

Definisi yang mereferensikan definisi ini: langkah-langkah

Properti

script String. Diperlukan sebagai properti pertama.
Skrip sebaris.

failOnStderr String.
Gagalkan tugas jika output dikirim ke Stderr?

workingDirectory String.
Mulai skrip dengan direktori kerja ini.

condition String.
Evaluasi ekspresi kondisi ini untuk menentukan apakah akan menjalankan tugas ini.

continueOnErrorboolean.
Terus berjalan bahkan pada kegagalan?

displayName String.
Nama yang dapat dibaca manusia untuk tugas tersebut.

targettarget.
Lingkungan tempat menjalankan tugas ini.

enabledboolean.
Jalankan tugas ini ketika pekerjaan berjalan?

env kamus string.
Variabel untuk dipetakan ke lingkungan proses.

name String.
ID langkah. Nilai yang dapat diterima: [-_A-Za-z0-9]*.

timeoutInMinutes String.
Waktu untuk menunggu tugas ini selesai sebelum server mematikannya.

Catatan

Alur dapat dikonfigurasi dengan batas waktu tingkat pekerjaan. Jika interval batas waktu tingkat pekerjaan berlalu sebelum langkah Anda selesai, pekerjaan yang sedang berjalan (termasuk langkah Anda) dihentikan, bahkan jika langkah dikonfigurasi dengan interval yang lebih lama timeoutInMinutes . Untuk informasi selengkapnya, lihat Batas Waktu.

retryCountOnTaskFailure String.
Jumlah percobaan ulang jika tugas gagal.

Keterangan

Kata script kunci adalah pintasan untuk tugas baris perintah. Tugas menjalankan skrip menggunakan cmd.exe di Windows dan Bash pada platform lain.

Pelajari selengkapnya tentang kondisi, batas waktu, dan target langkah.

Contoh

Jika Anda tidak menentukan mode perintah, Anda dapat mempersingkat target struktur menjadi:

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

Lihat juga