mdb / middleman-build-reporter

Fingerprint your Middleman build with version details.
13 stars 3 forks source link

Error in Jenkins when running ' bundle exec middleman build' #7

Open scooter11961 opened 9 years ago

scooter11961 commented 9 years ago

Hi there. I'm guessing something isn't getting returned from the git call as expected? This works fine on my local mac, fails on Jenkins server. Any ideas?

Console log:

/usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/middleman-build-reporter-0.0.4/lib/middleman-build-reporter/reporter.rb:41:in merge': no implicit conversion of false into Hash (TypeError) from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/middleman-build-reporter-0.0.4/lib/middleman-build-reporter/reporter.rb:41:indetails' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/middleman-build-reporter-0.0.4/lib/middleman-build-reporter/reporter.rb:61:in serialize' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/middleman-build-reporter-0.0.4/lib/middleman-build-reporter/reporter.rb:21:inblock in write' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/middleman-build-reporter-0.0.4/lib/middleman-build-reporter/reporter.rb:18:in each' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/middleman-build-reporter-0.0.4/lib/middleman-build-reporter/reporter.rb:18:inwrite' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/middleman-build-reporter-0.0.4/lib/middleman-build-reporter/extension.rb:16:in after_build' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/middleman-core-3.3.6/lib/middleman-core/extension.rb:159:inblock in bind_after_build' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/uber-0.0.8/lib/uber/options.rb:80:in instance_exec' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/uber-0.0.8/lib/uber/options.rb:80:inproc!' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/uber-0.0.8/lib/uber/options.rb:69:in evaluate_for' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/uber-0.0.8/lib/uber/options.rb:60:inevaluate' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/hooks-0.4.0/lib/hooks/hook.rb:53:in execute_callback' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/hooks-0.4.0/lib/hooks/hook.rb:40:inblock in run' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/hooks-0.4.0/lib/hooks/hook.rb:39:in each' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/hooks-0.4.0/lib/hooks/hook.rb:39:ininject' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/hooks-0.4.0/lib/hooks/hook.rb:39:in run' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/hooks-0.4.0/lib/hooks.rb:55:inrun_hook_for' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/hooks-0.4.0/lib/hooks/instance_hooks.rb:6:in run_hook' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/middleman-core-3.3.6/lib/middleman-core/cli/build.rb:72:inbuild' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/thor-0.19.1/lib/thor/base.rb:440:instart' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/middleman-core-3.3.6/lib/middleman-core/cli.rb:72:in method_missing' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/thor-0.19.1/lib/thor/command.rb:29:inrun' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/thor-0.19.1/lib/thor/command.rb:126:in run' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/thor-0.19.1/lib/thor/base.rb:440:instart' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/middleman-core-3.3.6/lib/middleman-core/cli.rb:20:in start' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/gems/middleman-core-3.3.6/bin/middleman:18:in<top (required)>' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/bin/middleman:23:in load' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/bin/middleman:23:in

' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/bin/ruby_executable_hooks:15:in eval' from /usr/local/rvm/gems/ruby-2.1.1@mapquest/bin/ruby_executable_hooks:15:in
' Build step 'Execute shell' marked build as failure

mdb commented 9 years ago

Hi - Thanks for reporting the issue. Maybe you can help me attempt to reproduce?

It seems like something in the #details method is choking.

  1. Do you have a "#{app.root}/.build_reporter.yml" file? If so, what does it look like?
  2. Can you provide any details about your Jenkins env? What OS/dist/version is running this code? Is there an easy way for me to create a Vagrantbox that looks like it?
  3. Can I browse your middleman app code?
  4. Are you able to reproduce this with a version of middleman-build-reporter that putss the different method calls contained in Middleman::BuildReporter::Reporter#details? For example, adding the following to line 35 of middleman-build-reporter/lib/middleman-build-reporter/reporter.rb, re-running bundle exec middleman build, and providing me the output of each puts could help us isolate the problem:
def details
   puts "repo: #{repo.class}"
   puts "branch: #{repo.current_branch}"
   puts "revision: #{repo.log.first.to_s}"
   puts "build_time: #{build_time.to_s}"
   puts "options: #{options.to_s}"
   puts "details_extension: #{details_extension}"

  {
    'branch' => repo.current_branch,
    'revision' => repo.log.first.to_s,
    'build_time' => build_time.to_s,
    'version' => options.version
  }.merge(details_extension)
end

Thanks!