.run [-c "<condition>"] "<ProjectName>"
.runwait [-c "<condition>"] "<ProjectName>"
您可以利用 .run 和 .runwait 指令,從步驟指令啟動鏈結專案。如果專案有多個 Snapshot,系統會執行預設 Snapshot。
.run "BuildWindowsDriver"
系統會啟動 BuildWindowsDriver 專案。執行啟動的專案會立即繼續進行下個步驟。
.runwait "BuildWindowsDriver"
系統會啟動 BuildWindowsDriver 專案。系統會在 .runwait 步驟暫停執行啟動的專案。當 BuildWindowsDriver 專案完成並通過時,.runwait 步驟的狀態便會設為 pass。
.run -c "$HOMEDRIVE=C:" "Simple Echo"
只有在 HOMEDRIVE 變數具有值 C 時,系統才會執行 Simple Echo 專案。
.run Condition: 'C:' = 'C:' satisfied.
Queueing Project "Simple Echo" on server [WinBox].
Queued Build 'BUILD_202' of project 'Simple Echo'.
.run -c "$HOMEDRIVE=C:" "Simple Echo"
.run Condition: 'D:' = 'C:' unsatisfied, no project queued.
如果字串包含數字,系統就會以數值來比較字串。例如,其處理下列案例的情況如下所示。
.runwait -c "a12b<c42d" "Simple Echo"
.run Condition: '12' < '42' satisfied.
Queueing Project "Simple Echo" on server [WinBox].
Waiting for .run build (4411) to complete.
.run build is now running.
.run build has finished.
Build 'BUILD_203' of project 'Simple Echo' completed.
.runwait -c "f43g<>h43i" "Simple Echo"
.run Condition: '43' <> '43' unsatisfied, no project queued.
下列範例顯示如何使用指令來作為條件。請注意,指令必須以引號及反引號括住。
.run -c "`exit 1`" "Simple Echo"
Env .run encountered an error during variable expansion,
parameter [`exit1`] expanded to [].
Expansion returned non-zero exit, project will not be queued.
.run -c "`exit 0`" "Simple Echo"
Expansion returned zero exit, project will be queued.
Queueing Project "Simple Echo" on server [WinBox].
Queued Build 'BUILD_204' of project 'Simple Echo'.
當您使用 .runwait 且建置失敗時,日誌內容將類似下列所示。
.runwait "Fail Build"
Queueing Project "Fail Build" on server [WinBox].
Waiting for .run build (4413) to complete.
.run build is now running.
.run build has finished.
Build 'BUILD_3' of project 'Fail Build' Failed, setting step status to fail.