defunkt / cijoe Goto Github PK
View Code? Open in Web Editor NEWCI Joe is a fun Continuous Integration server. Unmaintained.
License: MIT License
CI Joe is a fun Continuous Integration server. Unmaintained.
License: MIT License
two developers are pushing nearly the same time (let say a minute diff, but build still running). the second push never gets built. is there a way to "queue" those concurrent requests?
thx in advance
Fritzek
Same issue as #50.
"runner = rake spec".
When run from the command-line, rake exits with status 0, but when invoked from a post-commit POST, Exception building: undefined method `exitstatus' for nil:NilClass
Can we have support for local branch (the branch that just exists on your local, not on the remote)? Thanks
Steps to reproduce:
This may be a rip issue or I may be retarded but I get this error (http://gist.github.com/163696) when trying to install with rip. There is a pretty good chance I am retarded.
Hi,
I have a weird behavior with CIJOE. When rake in invoked for the tests, it's loading the production environment instead of "test" or "cucumber". All logs are going to log/production.log, and tests are failing because of missing configurations in the production.rb file (of course).
the git/config contains :
[cijoe]
branch = develop
runner = /usr/bin/git submodule update --init && sudo rake gems:install && sudo rake gems:install RAILS_ENV=test && sudo rake gems:install RAILS_ENV=cucumber && rake db:migrate && rake -s
buildallfile = tmp/cijoe.txt
And if I run this command line with the user running cijoe, it's going fine.
Any idea ?
thanks
When I run cijoe using RVM & Ruby 1.9.1 I receive the following output:
The two "No such file or directory" errors are caused by the project_path variable being passed into CIJoe::Config.new() inside CIJoe::Config.method_missing().
The fix seems to be adding a splat operator to line 4 of config.rb:
new(command, *args)
Is there another place for questions and help?
mwotton@glamdring:~/ci_projects$ cijoe Hubris
/home/mwotton/.rip/active/bin/cijoe:4:in require': /home/mwotton/.rip/active/lib/cijoe.rb:90: formal argument cannot be an instance variable (SyntaxError) ...popen4(runner_command) do |@pid, stdin, stdout, stderr| ... ^ from /home/mwotton/.rip/active/bin/cijoe:4:in
this seems to be a common problem with the upgrade - http://www.ruby-forum.com/topic/142402
any chance of a fix?
Previously, i was able to run something like `curl -d "run tests" http://localhost:4567" to start a build, but this is no blowing up with the following output. Any ideas?
== Sinatra/1.2.6 has taken the stage on 4567 for development with backup from WEBrick
[2011-08-04 12:23:35] INFO WEBrick 1.3.1
[2011-08-04 12:23:35] INFO ruby 1.8.7 (2011-02-18) [i686-darwin10.6.0]
[2011-08-04 12:23:35] INFO WEBrick::HTTPServer#start: pid=70651 port=4567
Loaded Campfire notifier for source/spree.
TypeError - can't convert nil into String:
.rvm/gems/ruby-1.8.7-p334@spree/gems/json-1.5.3/lib/json/common.rb:148:in `initialize'
.rvm/gems/ruby-1.8.7-p334@spree/gems/json-1.5.3/lib/json/common.rb:148:in `new'
.rvm/gems/ruby-1.8.7-p334@spree/gems/json-1.5.3/lib/json/common.rb:148:in `parse'
I set up ci joe for two different rails apps. It works flawlessly for the smaller of the two. For the larger app it consistently times out after ~ 1000 seconds. CI Joe is running behind nginx and using Thin 1.2.4 Any suggestions on where I should be trying to boost a timeout setting?
Thanks very much for such a simple and easy to set up CI server. Congrats on the rackspace move as well.
Hi,
I'm getting the following error when I visit a cijoe instance running on any of my git repositories:
sh: line 0: cd: [<repo_pwd>]: No such file or directory
!! Unexpected error while processing request: undefined method `split' for nil:NilClass
where <repo_pwd> is the directory of the git repo.
Could this be to do with my ruby 1.9.2 environment? I've put some of my environment details below,
Cheers,
Steve
$ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.3]
$cijoe -v
/Users/stephenallred/.rvm/gems/ruby-1.9.2-p0/gems/choice-0.1.4/lib/choice/parser.rb:108: warning: Hash#index is deprecated; use Hash#key
/Users/stephenallred/.rvm/gems/ruby-1.9.2-p0/gems/cijoe-0.7.0/bin/cijoe:41:in block (3 levels) in <top (required)>': uninitialized constant Choice::Option::CIJoe (NameError) from /Users/stephenallred/.rvm/gems/ruby-1.9.2-p0/gems/choice-0.1.4/lib/choice/parser.rb:177:in
call'
from /Users/stephenallred/.rvm/gems/ruby-1.9.2-p0/gems/choice-0.1.4/lib/choice/parser.rb:177:in block in parse' from /Users/stephenallred/.rvm/gems/ruby-1.9.2-p0/gems/choice-0.1.4/lib/choice/parser.rb:155:in
each'
from /Users/stephenallred/.rvm/gems/ruby-1.9.2-p0/gems/choice-0.1.4/lib/choice/parser.rb:155:in parse' from /Users/stephenallred/.rvm/gems/ruby-1.9.2-p0/gems/choice-0.1.4/lib/choice.rb:93:in
parse'
from /Users/stephenallred/.rvm/gems/ruby-1.9.2-p0/gems/choice-0.1.4/lib/choice.rb:26:in options' from /Users/stephenallred/.rvm/gems/ruby-1.9.2-p0/gems/cijoe-0.7.0/bin/cijoe:6:in
<top (required)>'
from /Users/stephenallred/.rvm/gems/ruby-1.9.2-p0/bin/cijoe:19:in load' from /Users/stephenallred/.rvm/gems/ruby-1.9.2-p0/bin/cijoe:19:in
$gem list | grep cijoe
cijoe (0.7.0)
Installing cijoe halts at this phrase
rip: choice requested by cijoe (0.1.0) but not found at git://github.com/defunkt/choice.git
obvously this package exists, but rip can't get it. Also when I try to install choice via gems, it can install but that doesn't mean cijoe works. In fact it can't find the cijoe executable when I run it, but the rip package is installed. I can't reinstall rip until I uninstall it, then when I run it again, I still get the same problem with choice.
Just wanted to mention this as it may be a problem with rip as well
In the 'old fashion way:' for adding campfire settings it should be campfire.subdomain not campfire.domain:
i.e.
git config --add campfire.domain github
should be
git config --add campfire.subdomain github
Thanks!
Is there support for keeping a build history log? Google tells me that there used to be "cijoe.buildhistory", but trying it out on our installation didn't do anything.
Just tried setting up two git repositories using a rackup file, and failed bitterly. Even though the support seems to be there to run multiple projects within one Joe process, I don't think that's possible at the moment, unless I understood something completely wrong.
I looked through the source, and it seems the reason for that is rather simple. When a CIJoe instance is initialized Dir.chdir is supposed to change the current working directory to the project's directory. The problem with multiple projects is that it only works for the first one with relative path and is sure to wreak havoc when used with absolute paths, because it sets the current directory for the whole process, so all commands from project A will be run in the directory of project B, or worst case, with relative paths Joe won't find the project, because expand_path is adding project A's project path to project B's relative path.
I'm not sure how to fix this properly, because it affects the Config class as well as the CIJoe code. One workaround would be to wrap all commands in a Dir.chdir block which resets the current directory after the given block was executed. That might be just enough to run a single commands without having different project builders interfere with each other. Though I'm not too sure yet how the Config class should be changed to work with that concept.
Any thoughts or pointers? I might be totally off here, but even my simple test failed bitterly, so maybe not.
This one was really tricky to track down. I setup my project using the suggested config.ru, like so:
require 'rubygems'
require 'cijoe'
use Rack::CommonLogger
CIJoe::Server.configure do |config|
config.set :project_path, '/srv/cijoe/myproject'
config.set :show_exceptions, true
config.set :lock, true
end
run CIJoe::Server
But, I was seeing an error like this when running a config.ru under passenger, or even shotgun.
private method `split' called for nil:NilClass
/usr/lib/ruby/gems/1.8/gems/cijoe-0.3.0/lib/cijoe.rb: in git_user_and_project, line 143
The symptom here is that Config.remote.origin.url.to_s
is returning empty string, so when you try to chomp a string off, you get nil, and nil can't be split.
Further investigation suggest the current directory was /srv/cijoe/myproject
. The trick is that Config tries to cd into a directory, and bases it somewhere... but it tries to cd into $project_path || File.join(File.dirname(__FILE__), '../../')
. If you were using the cijoe
command line, you'd be fine, since it sets $project_path
. Since the config.ru doesn't, it defaults to ../../
, which when installed as a gem, ends up being somewhere under /usr
, and definitely is wrong.
The quick fix would be to just set $project_path
, but that seems nasty. I'd hope that configuring the project_path would work as expected, so probably CIJoe::Config
needs some more smarts to know about that configuration.
We're using cijoe along with passenger (to have the "multi-project" support).
We have notices that if the web server is reload (ie : passenger reload as well), the app is restarted, leaving the current build stuck.
I think the .git/builds/current file should be removed at some point, maybe at start-up ?
thanks
Should cijoe run tests with a clean ENV, leaving it up to the test script to set everything up?
This might(?) make it more difficult to easily setup tests, but will definitely stop unwanted environment mixups.
Is there a plan in place to get Campfire working with the new API?
I can't seem to get the campfire notifications going.
I set the campfire settings in the .git/config, as per the docs, but when I run I get "Please check your campfire config for /path/to/project."
I've tried quoting values, using the campfire room number rather than the room name, and playing with the SSL option, but nothing helped.
Is there somewhere I can debug the issue? All I get back from WEBrick is the above message & there's nothing useful in the .git/builds/latest.
http://github.com/defunkt/cijoe/commit/1eca495bed36940e3d7fe8855116ef123404a09c
causes issues when OUTPUT contains a ` character. I patched cijoe to just use ENV instead:
http://github.com/tmm1/cijoe/commit/7aa426d15ea51e7f1446310ec9a279522f3df1b0
just fixed a bunch of bugs i ran into in http://github.com/tmm1/cijoe/compare/defunkt:master...master
most were caused due to our test suite generating a ton of output, which was causing all calls to git and hooks to fail. turns out there's a hard limit of 128k of data that can be passed to a subprocess via the argument list and environment variables, before exec starts failing with E2BIG
It's still referring to using a password when using Campfire, but you actually now (and as reflected in campfire.rb) need to use an API token instead. Should save a few headaches.
I'm attempting to set up cijoe and I encountered an issue. To check basic functionality of cijoe I then attempted to run the test suite, which failed:
m$ rake
(in /home/rm/apps/cijoe)
rake aborted!
Don't know how to build task 'check_dependencies'
(See full trace by running task with --trace)
It would be really cool if cijoe checked for submodules and updated them before running tests. I'm setting up the after-reset hook to do this, but it's a pain in the butt.
Hi,
I currently have C.I. Joe running against 2 repos, setup as per the article in the README (http://chrismdp.github.com/2010/03/multiple-ci-joes-with-rack-and-passenger/)
Things seem to work fine, until I add in campfire notifications. I can add the campfire.token, campfire.subdomain & campfire.ssl params fine, but as soon as I add campfire.room, all I get when I try to access a project is "500 Internal Server Error".
I checked the Apache log (https://gist.github.com/d055f70a7186e240e569), it appears to be missing "delegate" method in ActiveSupport, that's called by Tinder, which gets called in the campfire initialiser.
I'm guessing something isn't validating properly? If I remove the param and restart Apache, everything runs fine again.
I've tried quoting the room name, and I've also tried using the room number (quoted & unquoted), but neither worked.
I thought it might be that we have 2 rooms "Livfe" & "Livfe Support", and that it wasn't handling the string correctly, but if I create a new room called "test" it still 500s.
Any ideas?
Thanks,
mark
The tinder 1.2.0 gem currently returns [] when querying for Campfire rooms. So the room#speak method called within Joe fails. Here's a quick fix using tinder 1.4.0:
http://github.com/hpoydar/cijoe/commit/b0819492b316109fa1fce2d8be6ae252b06021f3
I'll send a pull request too.
I was having some trouble getting the Campfire notifications going (see: #73), so decided to write my own stop-gap notifications using the example ruby code 37Signals provide & the build-worked / build-failed git hooks.
I can get these to run fine when calling from the command line, but they fail when being called by cijoe.
I thought it might be that it didn't like running ruby scripts (although I would have thought it should respect the shebang?), so I switched for simple shell scripts (echo a string to file), but still no dice.
Both the ruby script & the shell script run fine from the command line, but don't seem to get called under cijoe.
I'm running Ubuntu 11.04, so not sure if this might be related to #69 ?
Why do we run hooks via sh
? I would like to write them using ruby, but setting a #!/usr/bin/env ruby
shebang has no effect.
consistently caused by suites that spin up other ruby processes (at least on 1.8.6). see my pull request for tested patch & example.
On Ubuntu 10.10 after doing this guide http://affinitybridge.com/blog/guide-simplified-automated-drupal-testing
I get the following:
/home/lsolesen/.gem/ruby/1.9.1/gems/cijoe-0.7.0/bin/cijoe:51:in `expand_path': can't convert nil into String (TypeError)
from /home/lsolesen/.gem/ruby/1.9.1/gems/cijoe-0.7.0/bin/cijoe:51:in `<top (required)>'
from /home/lsolesen/.gem/ruby/1.9.1/bin/cijoe:19:in `load'
from /home/lsolesen/.gem/ruby/1.9.1/bin/cijoe:19:in `<main>'
Not sure if this is a bug in our code, in the RedirectTo rspec matcher, or cijoe itself.
Multiple Cijoe's + Rack + Nginx similar to the described at
The only tweaking was to change the directory structure (using cijoe/app/repos for the actual projects instead of cijoe-repos and cijoe/public for root instead of cijoe)
The setup works great, the environment is properly configured and the git hooks properly fire.
response.should redirect_to(:action => :index)
When run from the command line using the same cijoe.runner command, it works fine. When run inside Cijoe, the paths do not properly resolve resulting in a precondition-like expection
Here is the failing stack trace (not overly useful)
/home/deployer/.rvm/gems/ruby-1.8.7-p334@oss_db/gems/actionpack-2.3.11/lib/action_controller/routing/recognition_optimisation.rb:66:in `recognize_path'
/home/deployer/.rvm/gems/ruby-1.8.7-p334@oss_db/gems/rspec-expectations-2.4.0/lib/rspec/expectations/handler.rb:11:in `handle_matcher'
/home/deployer/.rvm/gems/ruby-1.8.7-p334@oss_db/gems/rspec-expectations-2.4.0/lib/rspec/expectations/extensions/kernel.rb:27:in `should'
./spec/controllers/main_spec.rb:44:
I dug deeper and determined which line in rspec's RedirectTo class is causing the exception.
Rspec is failing on the "actual" path around line 32 (shown below)
if @expected.instance_of? Hash
return false unless @actual =~ %r{^\w+://#{@request.host}}
return false unless actual_redirect_to_valid_route # this method is failing
return actual_hash == expected_hash && @status_matched
else
If you inspect the response, you see that the REQUEST_URI is invalidly set to
/myproject/admin/index
The "myproject" is not valid and it should just be /admin/index. When run within Cijoe, the URI is prepending the name of the project (i.e. myproject), which is not a valid path resulting in that internal exception shown above. When run on the same machine, from the same environment on the command line, the "myproject" is not added to the URI and the test passes.
Direction, if possible on how best to resolve this issue. Is Cijoe setting something up that Rspec doesn't expect, is Rack doing something special, is Rspec not handling this subdirectory case properly
I would prefer to not change my test (at least not that much), so any insight would be greatly appreciated.
in sinatra's web page.
Thanks
Hi,
we've switched to bundler (0.9) recently, and CIJOE doesn't seem to like it :
Using rake (0.8.7) from system gems Using Saikuro (1.1.0) from system gems Using SystemTimer (1.2) from bundler gems Using abstract (1.0.0) from system gems Using activesupport (2.3.8) from system gems Using rack (1.1.0) from system gems [...] Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. /usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" [...] ** Erubis 2.6.6 ** Erubis 2.6.6 Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader Started ............................................................................................................................................................................................................................................................................................................................................................................................................. Finished in 92.660647 seconds. 397 tests, 816 assertions, 0 failures, 0 errors /usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" Errors running test:units!
I'm running :
bundle install
rake
as the build command.
Thanks
if the repo hasn't been yet pushed cijoe fails on:
def git_user_and_project
Config.remote.origin.url.to_s.chomp('.git').split(':')[-1].split('/')[-2, 2]
end
I have had all sorts of trouble running cijoe in inittab. Every time I run it, whether it be with nohup, adding the ampersand on the end, or running regular, the inittab process dies with the error:
Process spawning too fast. Killing process and respawning...
Any idea what I am doing wrong?
ree-1.8.7-2010.02 [~] ➔ gem list cijoe
*** LOCAL GEMS ***
cijoe (0.7.0)
ree-1.8.7-2010.02 [~] ➔ cijoe -v
/Users/millisami/.rvm/gems/ree-1.8.7-2010.02/gems/cijoe-0.7.0/bin/cijoe:41: uninitialized constant CIJoe (NameError)
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02/gems/choice-0.1.4/lib/choice/parser.rb:177:in `call'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02/gems/choice-0.1.4/lib/choice/parser.rb:177:in `parse'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02/gems/choice-0.1.4/lib/choice/parser.rb:155:in `each'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02/gems/choice-0.1.4/lib/choice/parser.rb:155:in `parse'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02/gems/choice-0.1.4/lib/choice.rb:93:in `parse'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02/gems/choice-0.1.4/lib/choice.rb:26:in `options'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02/gems/cijoe-0.7.0/bin/cijoe:6
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02/bin/cijoe:19:in `load'
from /Users/millisami/.rvm/gems/ree-1.8.7-2010.02/bin/cijoe:19
ree-1.8.7-2010.02 [~] ➔
Not sure when things went bad, was working. But, now I get an error when starting Joe.
cd: 1: can't cd to [/home/me/Development/proj]
I'm on Ubuntu 10.04 with a RVM-based install of ruby-1.9.2-p0 and all my gems updated. Anyone else see this?
Joe actually complains about "Error calling git config..." but the failure is at the cd step in the Config. Maybe a Choice problem?
You probably won't be interested with that because you want to keep cijoe simplest as possible, so I don't do a pull request, but just in case : I added a deploy button to deploy on demand :
https://github.com/oelmekki/cijoe
It runs the command : "cap production deploy" (using multistaging capistrano extension)
Is there a way to configure cijoe to run against all branches sent to it via the post-commit github notification? We want to run all of our tests automatically to our topic branches, but CIJoe, as-is, will only listen and respond when a push goes out to the one we've configured in the .git repo... Thanks!
Matt
For some reason I am getting an exception
at the end of the build.
$?.exitstatus
is breaking because $? is nil,
not sure why this would happen?
Hi
Freshly installed ruby-1.9.2-p0 via rvm, Ubuntu 10.04:
$ gem install cijoe $ cijoe my-github-repo cd: 1: can't cd to [/home/leemhenson/src/github/my-github-repo] /home/leemhenson/.rvm/gems/ruby-1.9.2-p0/gems/cijoe-0.7.0/lib/cijoe/config.rb:25:in `to_s': Error calling git config, is a recent version of git installed? Command: "cd [\"/home/leemhenson/src/github/my-github-repo\"] && git config cijoe.user", Error: "", Status: Process::Status: pid 14569 exit 2 (RuntimeError) from /home/leemhenson/.rvm/gems/ruby-1.9.2-p0/gems/cijoe-0.7.0/lib/cijoe/server.rb:73:in `project_path=' from /home/leemhenson/.rvm/gems/ruby-1.9.2-p0/gems/sinatra-1.0/lib/sinatra/base.rb:706:in `set' from /home/leemhenson/.rvm/gems/ruby-1.9.2-p0/gems/cijoe-0.7.0/lib/cijoe/server.rb:68:in `start' from /home/leemhenson/.rvm/gems/ruby-1.9.2-p0/gems/cijoe-0.7.0/bin/cijoe:51:in `' from /home/leemhenson/.rvm/gems/ruby-1.9.2-p0/bin/cijoe:19:in `load' from /home/leemhenson/.rvm/gems/ruby-1.9.2-p0/bin/cijoe:19:in `' $ which git /usr/bin/git $ git --version git version 1.7.0.4
I'm inexperienced with ruby and ubuntu, so I might be missing something obvious. The status code of 2 from the "cd ...&& git config cijoe.user" command would seem to be the issue though. I can't find anything definitive of what that means? Some dodgy config on my system maybe?
Any help appreciated!
Cheers
Lee
I would be perfect if it was possible to run multiple projects on the same port, so you do not need to startup several instances of cijoe, but could use the same cijoe for more projects.
Can we get a new gem pushed soon? Specifically, I would like commit 1eca495. Cheers.
The sha hash in the build status is linking to the wrong place.
http://github.com/user/project/commits/blah
when it should be:
It'd be nice if these changes somehow got pulled in.
http://github.com/glennr/cijoe.git
I'd like to be able to see semi-live progress as the build is running (last X lines) and be able to download the entire log after the build is done.
I was having some problems posting to campfire, which I managed to trace to this:
#<NoMethodError: undefined method `url' for nil:NilClass>
("/Users/james/.rvm/gems/ree/1.8.6/gems/cijoe-0.2.0/bin/../lib/cijoe/campfire.rb:45:in `notify'")
It seems that the sha
was missing for that build. After some more poking around, I found that in the 'build!' method, while the SHA was being set on the build
variable, this didn't seem to be setting sha
in @current_build
. See http://github.com/defunkt/cijoe/blob/master/lib/cijoe.rb#L102 for the method I'm talking about.
Though I can't explain why sha
isn't set in @current_build
, given it should be the same object as is in build
, replacing all instances of the local variable build
with @current_build
in my local copy fixed the issue.
Can you shed any light?
When installing via 'gem install cijoe', I'm unable to use basic auth - cijoe errors out with
undefined method `use' for #<CIJoe::Server:0x7f0ea3bc3910>
Sinatra::Base#use is a class method and not an instance method in 0.9.4, so that can't be right. Looking at the source installed with the gem, it appears that the latest code on github (which calls 'use' in the right context for my version of Sinatra) hasn't been pushed out to gemcutter, or something about Sinatra has changed in the meantime.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.