0
如何在Jenkins控制檯輸出上使用shell腳本在每行的開頭處打印Servername。我越來越servernames節點作爲參數一樣sd009.domain.com,sw009.domain.com從主動選擇參數插件如何在控制檯輸出的每行中顯示服務器名稱
實際輸出:
ssh -o stricthostkeychecking = no [email protected] 'ls -lrt'
ssh -o stricthostkeychecking = no [email protected] 'pwd'
ssh -o stricthostkeychecking = no [email protected] 'hostname'
PS_EXE="/cygdrive/windows/powershell.exe"
我的預期輸出:
sd09.domain.com ssh -o stricthostkeychecking = no [email protected] 'ls -lrt'
sd09.domain.com ssh -o stricthostkeychecking = no [email protected] 'pwd'
sd09.domain.com ssh -o stricthostkeychecking = no [email protected] 'hostname'
sd09.domain.com PS_EXE="/cygdrive/windows/powershell.exe"
看到我需要顯示我所選擇的服務器名在所有的輸出行中,像上面在執行shell程序段中使用shell腳本代碼。 請儘早幫助我實現此目標。
我不明白的問題,因爲你不顯示產生實際輸出的腳本。你想問如何在文件的每一行上添加一個固定的字符串? – user1934428
你的意思是你想改變你的提示嗎? –
我在jenkins中的執行shell程序塊中寫了這段代碼。我在運行時部署服務器,我的要求是顯示jenkins輸出控制檯中每行開始時在當前工作的servername。 –