Megosztás a következőn keresztül:


steps.script definition

A script lépés egy szkriptet futtat cmd.exe használatával Windowson és Bashen más platformokon.

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.

A definícióra hivatkozó definíciók: lépések

Tulajdonságok

script sztring. Első tulajdonságként kötelező megadni.
beágyazott szkriptet.

failOnStderr sztring.
Sikertelen a feladat, ha a kimenetet a Stderrnek küldi?

workingDirectory sztring.
Indítsa el a szkriptet ezzel a munkakönyvtárral.

condition sztring.
A feltételkifejezés kiértékelése annak meghatározásához, hogy futtassa-e ezt a feladatot.

continueOnError logikai.
Továbbra is fut a hiba?

displayName sztring.
feladat emberi olvasható nevét.

target cél.
környezetet, amelyben futtatni szeretné ezt a feladatot.

enabled logikai.
Futtassa ezt a feladatot a feladat futtatásakor?

env sztringszótár.
változókat a folyamat környezetébe való leképezéshez.

name sztring.
lépés azonosítója. Elfogadható értékek: [-_A-Za-z0-9]*.

timeoutInMinutes sztring.
Várakozási idő, amíg a feladat befejeződik, mielőtt a kiszolgáló leáll.

Megjegyzés

A folyamatok konfigurálhatók feladatszintű időtúllépéssel. Ha a feladatszint időtúllépési időköze a lépés befejezése előtt eltelik, a futó feladat (beleértve a lépést is) leáll, még akkor is, ha a lépés hosszabb timeoutInMinutes intervallummal van konfigurálva. További információ: időtúllépések.

retryCountOnTaskFailure sztring.
Újrapróbálkozések száma, ha a feladat meghiúsul.

Megjegyzések

A script kulcsszó a parancssori feladatparancsikonja. A feladat egy szkriptet futtat cmd.exe használatával Windows és Bash rendszeren más platformokon.

További információ a feltételekről, időtúllépésekről, valamint .

Példák

Ha nem ad meg parancsmódot, lerövidítheti a target struktúrát a következőre:

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

Lásd még