2014-08-29 57 views
1

有沒有辦法告訴Jenkins CI沉默(不記錄)bash腳本的一部分?Jenkins CI日誌的沉默部分

像這樣

# silence begin 
echo "this should not log 
# silence end 

echo 'this should log' 

的事情是我加載RVM在詹金斯作爲一個函數,由於打擊「不登錄」的保護。但是,輸出整個RVM配置到我的日誌=>第8000行日誌對我來說沒用。

謝謝

回答

1

如何禁止bash輸出而不是詹金斯?
我的意思是,這個方法工作對你有好處:

# silence begin 
echo "this should not log" > /dev/null 
# silence end 

echo 'this should log' 

This question看起來與我的答案。

更新通過Equivalent8:

這個工程,爲我的情況下,我需要使用>&

# RVM setting 
source ~/.bashrc   >& /dev/null # load bashrc conf 
source ~/.rvm/scripts/rvm >& /dev/null # standard RVM code 
type rvm | head -1      # ensule rvm is is function mode 
rvm use [email protected]_project >& /dev/null # use ruby version 
+0

謝謝你饞嘴:) – equivalent8 2014-08-29 14:39:14

+0

@ equivalent8,歡迎您:) – Gluttton 2014-08-29 15:28:58