2

The thing is I'm loading RVM in Jenkins as a function due to bash "not a login" protection. That however outputs the whole RVM configuration to my log => first 8000 lines of log are useless to me.

Is there a way to tell Jenkins CI to silence (not to log) part of the bash script?

something like this

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

echo 'this should log'

Thank you

Ryan Lyu
  • 2,630
  • 2
  • 22
  • 38
equivalent8
  • 12,962
  • 7
  • 77
  • 103

1 Answers1

2

What about suppress bash output instead of Jenkins?
I mean is this approach works good for you:

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

echo 'this should log'

This question looks like related to my answer.

update by Equivalent8:

this works, and for my situation I needed to use >& :

# 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 2.1.2@my_project   >& /dev/null # use ruby version 
Community
  • 1
  • 1
Gluttton
  • 5,473
  • 2
  • 30
  • 55