Module: QAT::Jenkins
- Defined in:
- lib/qat/jenkins.rb
Overview
Jenkins helper. Should be required by the Cucumber module then running tests in a Jenkins server.
Constant Summary collapse
- DEFAULT_ENV_VARS =
Default Jenkins environment variables to add register in the
QAT::Logger
. [ 'BUILD_NUMBER', 'BUILD_URL', 'NODE_NAME', 'JOB_NAME', 'SVN_REVISION', 'GIT_COMMIT' ]
Class Method Summary collapse
-
.register_vars(opts = {}) ⇒ Object
Register Jenkins environment variables in the Log4r::MDC hash.
Class Method Details
.register_vars(opts = {}) ⇒ Object
Register Jenkins environment variables in the Log4r::MDC hash. By default only the DEFAULT_ENV_VARS will be registered.
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/qat/jenkins.rb', line 30 def self.register_vars(opts={}) ignore_list = opts[:ignore] || [] add_list = opts[:add] || [] list = DEFAULT_ENV_VARS + add_list - ignore_list list.each do |var| Log4r::MDC.put var, ENV[var] if ENV[var] end end |