簡體   English   中英

如何設置在jenkins構建上運行的rspec

[英]how to setup rspec run on jenkins build

我正在嘗試為我的Rails應用設置詹金斯。 所以基本上我希望構建在運行時運行rspec並通過/失敗

  1. 點擊手動構建
  2. 提交到master后,立即觸發構建並運行rspec。

我的詹金斯人在8080端口上運行。

在詹金斯,我有以下配置:

github project url: https://github.com/myuser/sample_app_rails_4/
git repository ur: https://github.com/myuser/sample_app_rails_4.git

在我的github設置中,我設置了jenkins webhook,如下所示:

Jenkins Hook url: pathtolocalhost:8080/github-webhook

在我的rails應用程序中,我具有ci-reporter gem設置,這是我的rakefile的樣子:

require File.expand_path('../config/application', __FILE__)
require 'ci/reporter/rake/rspec'
task :rspec => 'ci:setup:rspec'


SampleApp::Application.load_tasks

現在,當我嘗試通過jenkins localhost手動構建時,構建失敗並顯示:

[sample_app] $ /usr/bin/rake
rake aborted!
Bundler::GemNotFound: Could not find activesupport-4.0.8 in any of the sources
Build step 'Invoke Rake' marked build as failure

另外,當我將提交推送到主服務器時,構建不會自動觸發。

有人可以向我提供有關我可能做錯了什么的指示,以使rspec在構建時手動以及在提交時自動運行嗎?

我認為您遇到的問題是您沒有使用bundle exec rake 如果使用系統耙,您將不會擁有捆綁的所有寶石(我假設您正在使用捆綁器)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM