2

我有一个类似的问题:詹金斯停止了检查修订的工作(我认为......)我的问题不是它挂断而是它只是崩溃了。我似乎无法弄清楚出了什么问题。我不知道,控制台输出并没有真正帮助我。任何帮助,将不胜感激!

Started by user my_repo
Building in workspace /var/lib/jenkins/jobs/Test my_repo master/workspace
Checkout:workspace / /var/lib/jenkins/jobs/Test my_repo master/workspace - hudson.remoting.LocalChannel@3301b455
Using strategy: Default
Last Built Revision: Revision 1f3c154da300f5e8b96b7c1ba6d683913e96ea31 (origin/master)
Fetching changes from 1 remote Git repository
Fetching upstream changes from git@github.com:my_repo/my_repo.git
Commencing build of Revision 1f3c154da300f5e8b96b7c1ba6d683913e96ea31 (origin/master)
Checking out Revision 1f3c154da300f5e8b96b7c1ba6d683913e96ea31 (origin/master)
[workspace] $ /bin/bash -xe /tmp/hudson5411167788999806789.sh
+ source /var/lib/jenkins/.bashrc
++ PATH=/var/lib/jenkins/.rvm/gems/ruby-1.9.3-p385/bin:/var/lib/jenkins/.rvm/gems/ruby-1.9.3-p385@global/bin:/var/lib/jenkins/.rvm/rubies/ruby-1.9.3-p385/bin:/var/lib/jenkins/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/var/lib/jenkins/.rvm/bin
++ '[' -s /var/lib/jenkins/.rvm/scripts/rvm ']'
++ source /var/lib/jenkins/.rvm/scripts/rvm
+++ __rvm_has_opt posix
+++ [[ -n '' ]]
+++ [[ -n 4.2.24(1)-release ]]
+++ [[ :braceexpand:errexit:hashall:interactive-comments:xtrace: =~ :posix: ]]
+++ return 1
+++ export HOME rvm_prefix rvm_user_install_flag rvm_path
+++ HOME=/var/lib/jenkins
+++ [[ -n '' ]]
++++ umask
+++ export rvm_stored_umask=0022
+++ rvm_stored_umask=0022
+++ ((  0 == 0  ))
+++ rvm_rvmrc_files=("/etc/rvmrc" "$HOME/.rvmrc")
+++ [[ -n /var/lib/jenkins ]]
+++ [[ /var/lib/jenkins/.rvmrc -ef /var/lib/jenkins/.rvmrc ]]
+++ for rvmrc in '"${rvm_rvmrc_files[@]}"'
+++ [[ -f /etc/rvmrc ]]
+++ for rvmrc in '"${rvm_rvmrc_files[@]}"'
+++ [[ -f /var/lib/jenkins/.rvmrc ]]
+++ GREP_OPTIONS=
+++ grep '^\s*rvm .*$' /var/lib/jenkins/.rvmrc
+++ source /var/lib/jenkins/.rvmrc
++++ export rvm_trust_rvmrcs_flag=1
++++ rvm_trust_rvmrcs_flag=1
+++ unset rvm_rvmrc_files
+++ [[ -z /var/lib/jenkins/.rvm ]]
+++ rvm_path=/var/lib/jenkins/.rvm
+++ [[ -z /var/lib/jenkins ]]
+++ [[ -z '' ]]
+++ [[ /var/lib/jenkins == \/\v\a\r\/\l\i\b\/\j\e\n\k\i\n\s ]]
+++ rvm_user_install_flag=1
+++ export rvm_loaded_flag
+++ [[ -n 4.2.24(1)-release ]]
+++ typeset -f rvm
+++ rvm_loaded_flag=0
+++ ((  0 == 0  ))
+++ [[ -n /var/lib/jenkins/.rvm ]]
+++ [[ -d /var/lib/jenkins/.rvm ]]
+++ true /var/lib/jenkins/.rvm/scripts
+++ [[ -f /var/lib/jenkins/.rvm/scripts/base ]]
+++ source /var/lib/jenkins/.rvm/scripts/base
++++ __rvm_has_opt errexit
++++ [[ -n '' ]]
++++ [[ -n 4.2.24(1)-release ]]
++++ [[ :braceexpand:errexit:hashall:interactive-comments:xtrace: =~ :errexit: ]]
++++ rvm_stored_errexit=1
++++ set +e
++++ : rvm_trace_flag:0
++++ ((  rvm_trace_flag > 0  ))
++++ export __array_start rvm_path
(............  a lot more of the same output.........)
++ hooks+=("$PWD/.rvm/hooks")
++ _hooks_list=($(
    find -L "${hooks[@]}" -iname "$rvm_hook*" -type f 2>/dev/null
  ))
+++ find -L /var/lib/jenkins/.rvm/hooks '/var/lib/jenkins/jobs/Test my_repo master/workspace/.rvm/hooks' -iname 'after_cd*' -type f
Build step 'Execute shell' marked build as failure
Finished: FAILURE

更新

我的构建 shell 命令如下所示:

source ~/.bashrc
cd .
rm -rf jenkins && mkdir jenkins
export RAILS_ENV=test
bundle install
rake db:drop db:create db:structure:load
SPEC_OPTS="--format html" rspec spec > jenkins/rspec.html
SPEC_OPTS="--format html" rspec spec_without_rails > jenkins/rspec.html
4

1 回答 1

4

这个问题与git无关。签出成功完成,第一个“Execute Shell”步骤开始执行,随后失败(如日志倒数第二行所示)。

RVM 命令(或其他命令)以某种方式失败。我猜是因为find执行找不到任何文件。

当脚本以非零返回码退出时,它会导致 Jenkins 构建失败。

于 2013-02-13T17:21:01.450 回答