cijoe 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,19 +12,13 @@ Because knowing is half the battle.
12
12
  Quickstart
13
13
  ----------
14
14
 
15
- Rip:
16
-
17
- $ rip install git://github.com/defunkt/cijoe.git
18
- $ git clone git://github.com/you/yourrepo.git
19
- $ cijoe yourrepo
20
-
21
- Gemcutter:
15
+ RubyGems:
22
16
 
23
17
  $ gem install cijoe
24
18
  $ git clone git://github.com/you/yourrepo.git
25
19
  $ cijoe yourrepo
26
20
 
27
- Boom. Navigate to http://localhost:4567 to see Joe in action.
21
+ Boom. Navigate to <http://localhost:4567> to see Joe in action.
28
22
  Check `cijoe -h` for other options.
29
23
 
30
24
  Basically you need to run `cijoe` and hand it the path to a git
@@ -55,15 +49,27 @@ build. Pull any metadata you want out of that scro.
55
49
 
56
50
 
57
51
  Other Branches
58
- --------------
52
+ ----------------------
59
53
 
60
54
  Want joe to run against a branch other than `master`? No problem:
61
55
 
62
56
  $ git config --add cijoe.branch deploy
63
57
 
64
58
 
59
+ Concurrent Push's - a kind of "queueing"
60
+ ----------------------------------------
61
+
62
+ Joe runs just one build at the time. If you expect concurrent push's
63
+ to your repo and want joe to build each in a kind of queue, just set:
64
+
65
+ $ git config --add cijoe.buildallfile tmp/cijoe.txt
66
+
67
+ Joe will save requests while another build runs. If more than one push
68
+ hits joe, he just picks the last after finishing the prior.
69
+
70
+
65
71
  Campfire
66
- --------
72
+ -------------
67
73
 
68
74
  Campfire notification is included, because it's what we use. Want Joe
69
75
  notify your Campfire? Put this in your repo's `.git/config`:
@@ -84,7 +90,7 @@ Or do it the old fashion way:
84
90
 
85
91
 
86
92
  Checkin' Status
87
- ---------------
93
+ ----------------------
88
94
 
89
95
  Want to see how your build's doing without any of this fancy UI crap?
90
96
  Ping Joe for the lowdown:
@@ -95,15 +101,18 @@ Joe will return `200 OK` if all is quiet on the Western Front. If
95
101
  Joe's busy building or your last build failed, you'll get `412
96
102
  PRECONDITION FAILED`.
97
103
 
104
+
98
105
  Multiple Projects
99
- -----------------
106
+ ------------------------
100
107
 
101
108
  Want CI for multiple projects? Just start multiple instances of Joe!
102
109
  He can run on any port - try `cijoe -h` for more options.
103
110
 
111
+ If you're using Passenger, see [this blog post](http://chrismdp.github.com/2010/03/multiple-ci-joes-with-rack-and-passenger/).
112
+
104
113
 
105
114
  HTTP Auth
106
- ---------
115
+ ----------------
107
116
 
108
117
  Worried about people triggering your builds? Setup HTTP auth:
109
118
 
@@ -112,7 +121,7 @@ Worried about people triggering your builds? Setup HTTP auth:
112
121
 
113
122
 
114
123
  GitHub Integration
115
- ------------------
124
+ --------------------------
116
125
 
117
126
  Any POST to Joe will trigger a build. If you are hiding Joe behind
118
127
  HTTP auth, that's okay - GitHub knows how to authenticate properly.
@@ -124,7 +133,7 @@ of your project's "Admin" tab.
124
133
 
125
134
 
126
135
  Daemonize
127
- ---------
136
+ ----------------
128
137
 
129
138
  Want to run Joe as a daemon? Use `nohup`:
130
139
 
@@ -132,7 +141,7 @@ Want to run Joe as a daemon? Use `nohup`:
132
141
 
133
142
 
134
143
  Other CI Servers
135
- ----------------
144
+ ------------------------
136
145
 
137
146
  Need more features? More notifiers? Check out one of these bad boys:
138
147
 
@@ -140,10 +149,11 @@ Need more features? More notifiers? Check out one of these bad boys:
140
149
  * [Integrity](http://integrityapp.com/)
141
150
  * [CruiseControl.rb](http://cruisecontrolrb.thoughtworks.com/)
142
151
  * [BuildBot](http://buildbot.net/trac)
152
+ * [Signal](http://www.github.com/dcrec1/signal)
143
153
 
144
154
 
145
155
  Screenshots
146
- -----------
156
+ ------------------
147
157
 
148
158
  ![Building](http://img.skitch.com/20090806-ryw34ksi5ixnrdwxcptqy28iy7.png)
149
159
 
@@ -151,7 +161,7 @@ Screenshots
151
161
 
152
162
 
153
163
  Questions? Concerns?
154
- --------------------
164
+ ---------------------------------
155
165
 
156
166
  [Issues](http://github.com/defunkt/cijoe/issues) or [the mailing list](http://groups.google.com/group/cijoe).
157
167
 
data/Rakefile CHANGED
@@ -20,10 +20,18 @@ begin
20
20
  gemspec.version = CIJoe::Version.to_s
21
21
  end
22
22
  rescue LoadError
23
- puts "Jeweler not available."
23
+ puts "Jeweler not available."
24
24
  puts "Install it with: gem install jeweler"
25
25
  end
26
26
 
27
+ desc "Publish a RubyGem"
28
+ task :publish => :gem do
29
+ $LOAD_PATH.unshift File.dirname(__FILE__) + '/lib'
30
+ require 'cijoe/version'
31
+
32
+ sh "gem push pkg/cijoe-#{CIJoe::Version}.gem"
33
+ end
34
+
27
35
  require 'rake/testtask'
28
36
  Rake::TestTask.new(:test) do |test|
29
37
  test.libs << 'lib' << 'test'
@@ -48,6 +48,12 @@ class CIJoe
48
48
 
49
49
  # kill the child and exit
50
50
  def stop
51
+ # another build waits
52
+ if Config.cijoe.buildallfile && File.exist?(Config.cijoe.buildallfile.to_s)
53
+ # clean out on stop
54
+ FileUtils.rm(Config.cijoe.buildallfile.to_s)
55
+ end
56
+
51
57
  Process.kill(9, pid) if pid
52
58
  exit!
53
59
  end
@@ -73,12 +79,29 @@ class CIJoe
73
79
  write_build 'current', @current_build
74
80
  write_build 'last', @last_build
75
81
  @last_build.notify if @last_build.respond_to? :notify
82
+
83
+ # another build waits
84
+ if Config.cijoe.buildallfile && File.exist?(Config.cijoe.buildallfile.to_s)
85
+ # clean out before new build
86
+ FileUtils.rm(Config.cijoe.buildallfile.to_s)
87
+ build
88
+ end
76
89
  end
77
90
 
78
- # run the build but make sure only
79
- # one is running at a time
91
+ # run the build but make sure only one is running
92
+ # at a time (if new one comes in we will park it)
80
93
  def build
81
- return if building?
94
+ if building?
95
+ # only if switched on to build all incoming requests
96
+ if Config.cijoe.buildallfile
97
+ # and there is no previous request
98
+ return if File.exist?(Config.cijoe.buildallfile.to_s)
99
+ # we will mark awaiting builds
100
+ FileUtils.touch(Config.cijoe.buildallfile.to_s)
101
+ end
102
+ # leave anyway because a current build runs
103
+ return
104
+ end
82
105
  @current_build = Build.new(@user, @project)
83
106
  write_build 'current', @current_build
84
107
  Thread.new { build! }
@@ -162,8 +185,8 @@ class CIJoe
162
185
  else
163
186
  {}
164
187
  end
165
- env = data.collect { |k, v| %(#{k}=#{v.inspect}) }.join(" ")
166
- `#{env} sh #{file}`
188
+ data.each{ |k, v| ENV[k] = v }
189
+ `sh #{file}`
167
190
  end
168
191
  end
169
192
 
@@ -1,3 +1,3 @@
1
1
  class CIJoe
2
- Version = "0.3.0"
2
+ Version = "0.4.0"
3
3
  end
@@ -19,7 +19,7 @@
19
19
  <li>
20
20
  <span class="date"><%= pretty_time(joe.current_build.started_at) if joe.current_build %></span> &raquo;
21
21
  <% if joe.current_build.sha %>
22
- Building <a href="<%= joe.url %>/commits/<%= joe.current_build.sha %>"><%= joe.current_build.short_sha %></a> <small>(pid: <%= joe.pid %>)</small>
22
+ Building <a href="<%= joe.current_build.commit.url %>"><%= joe.current_build.short_sha %></a> <small>(pid: <%= joe.pid %>)</small>
23
23
  <% else %>
24
24
  Build starting...
25
25
  <% end %>
@@ -30,7 +30,7 @@
30
30
 
31
31
  <% if joe.last_build %>
32
32
  <li>
33
- <span class="date"><%= pretty_time(joe.last_build.finished_at) %></span> &raquo; Built <a href="<%= joe.url %>/commits/<%= joe.last_build.sha %>"><%= joe.last_build.short_sha %></a> <span class="<%= joe.last_build.status %>">(<%= joe.last_build.status %>)</span>
33
+ <span class="date"><%= pretty_time(joe.last_build.finished_at) %></span> &raquo; Built <a href="<%= joe.last_build.commit.url %>"><%= joe.last_build.short_sha %></a> <span class="<%= joe.last_build.status %>">(<%= joe.last_build.status %>)</span>
34
34
  <% if joe.last_build.duration %>
35
35
  in <span class="duration"><%= joe.last_build.duration %></span> seconds.
36
36
  <% end %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cijoe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-28 00:00:00 -08:00
12
+ date: 2010-04-07 00:00:00 -07:00
13
13
  default_executable: cijoe
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency