2016-09-21 114 views
4

我在詹金斯的執行shell中有下面的代碼。我的要求是在每行中顯示servername參數以顯示在控制檯輸出中。我已經使用回聲,並獲得服務器名稱,他們正在控制檯中顯示。Jenkins在控制檯輸出頁面顯示回顯命令

​​

所有行包含回聲服務器,顯示服務器名稱

Output: 
+echo SD998.domain.com PS_EXE="/cygdrive/powershell.exe" 
SD998.domain.com PS_EXE="/cygdrive/powershell.exe" 
+echo SD999.domain.com "wget user=$User pwd= $pwd http://artifactory/dev-package.zip" 
SD999.domain.com "wget user=$User pwd= $pwd http://artifactory/dev-package.zip" 

回聲聲明是越來越顯示在控制檯輸出和下一輸出得到顯示。我需要從Console輸出中刪除與echo有關的語句。請幫我實現這一點。

+2

相關的問題和答案在這裏:HTTP ://stackoverflow.com/questions/26797219/echo-off-in-jenkins-console-output – Revive

+0

https://stackoverflow.com/questions/26797219/echo-off-in-jenkins-console-output – 2017-07-06 00:29:53

回答

1

如果您正在執行的任務在Linux從嘗試:

#!/bin/bash 
echo ${Server} PS_EXE="/cygdrive/powershell.exe" 
echo ${Server} "wget user=$User pwd= $pwd http://artifactory/dev-package.zip" 
echo ${Server} "sleep 20s" 

如果你是在一個窗口從執行嘗試執行Windows命令:

@echo %Server% PS_EXE="/cygdrive/powershell.exe" 
@echo %Server% "wget user=%User% pwd= %pwd% http://artifactory/dev-package.zip" 
@echo %Server% "sleep 20s" 
相關問題