janky 0.10.0 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +12 -0
- data/README.md +8 -0
- data/lib/janky/build.rb +4 -0
- data/lib/janky/hubot.rb +40 -12
- data/lib/janky/public/javascripts/application.js +8 -1
- data/lib/janky/version.rb +1 -1
- data/test/janky_test.rb +24 -0
- data/test/test_helper.rb +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d531dd95f17c83f106364fc9bb3b56a83e7c84f
|
4
|
+
data.tar.gz: ea8e851492074c805a207ec0938a0eff692e9e7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c10a412e74e88045013e915ad1859a481e949a01da50c207d26302fe2651d9d1e748cf9bb81399a0296adde8befcb4e53b062b5f7a5445a00bd52ade2afa60f
|
7
|
+
data.tar.gz: c8ea975e0f9b6527c80b2b91b796b9ca72d4cc3ee82a7503c302839c6476cb9ee43fb688494a23d453b2f5071574e85a7e73d7f59adc1ba29f63a85f81bd87d4
|
data/CHANGES
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
= 0.10.2 / 2013-10-02
|
2
|
+
|
3
|
+
* Revert AR deprecation warnings
|
4
|
+
* Revert previous configure jobs throwing error change
|
5
|
+
|
6
|
+
= 0.10.1 / 2013-09-20
|
7
|
+
|
8
|
+
* Refresh landing page every 5 seconds for updates
|
9
|
+
* Previously configured jobs reconfigure instead of throwing errors
|
10
|
+
* Add an API endpoint to get a json response full of build statuses
|
11
|
+
* Fixup stupid AR deprecation warnings
|
12
|
+
|
1
13
|
= 0.10.0 / 2013-09-19
|
2
14
|
|
3
15
|
* Upgrade sinatra_auth_github to work with latest octokit
|
data/README.md
CHANGED
@@ -79,6 +79,9 @@ Janky requires access to a Jenkins server. Version **1.427** is
|
|
79
79
|
recommended. Refer to the Jenkins [documentation][doc] for installation
|
80
80
|
instructions and install the [Notification Plugin][np] version 1.4.
|
81
81
|
|
82
|
+
Remember to set the Jenkins URL in `http://your-jenkins-server.com/configure`.
|
83
|
+
Janky will still trigger builds but will not update the build status without this set.
|
84
|
+
|
82
85
|
[doc]: https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins
|
83
86
|
[np]: https://wiki.jenkins-ci.org/display/JENKINS/Notification+Plugin
|
84
87
|
|
@@ -134,6 +137,7 @@ Required settings:
|
|
134
137
|
* `JANKY_BUILDER_DEFAULT`: The Jenkins server URL **with** a trailing slash.
|
135
138
|
Example: `http://jenkins.example.com/`. For basic auth, include the
|
136
139
|
credentials in the URL: `http://user:pass@jenkins.example.com/`.
|
140
|
+
Using GitHub OAuth with Jenkins is not supported by Janky.
|
137
141
|
* `JANKY_CONFIG_DIR`: Directory where build config templates are stored.
|
138
142
|
Typically set to `/app/config` on Heroku.
|
139
143
|
* `JANKY_HUBOT_USER`: Login used to protect the Hubot API.
|
@@ -174,6 +178,10 @@ via the GitHub API:
|
|
174
178
|
|
175
179
|
then set `JANKY_GITHUB_STATUS_TOKEN`.
|
176
180
|
|
181
|
+
`username` and `password` in the above example should be the same as the
|
182
|
+
values provided for `JANKY_GITHUB_USER` and `JANKY_GITHUB_PASSWORD`
|
183
|
+
respectively.
|
184
|
+
|
177
185
|
### Chat notifications
|
178
186
|
|
179
187
|
#### Campfire
|
data/lib/janky/build.rb
CHANGED
data/lib/janky/hubot.rb
CHANGED
@@ -80,6 +80,26 @@ module Janky
|
|
80
80
|
repos.join("\n")
|
81
81
|
end
|
82
82
|
|
83
|
+
# Get the lasts builds
|
84
|
+
get "/builds" do
|
85
|
+
limit = params["limit"]
|
86
|
+
building = params["building"]
|
87
|
+
|
88
|
+
builds = Build.unscoped
|
89
|
+
if building.blank? || building == 'false'
|
90
|
+
builds = builds.completed
|
91
|
+
else
|
92
|
+
builds = builds.building
|
93
|
+
end
|
94
|
+
builds = builds.limit(limit) unless limit.blank?
|
95
|
+
|
96
|
+
builds.map! do |build|
|
97
|
+
build_to_hash(build)
|
98
|
+
end
|
99
|
+
|
100
|
+
builds.to_json
|
101
|
+
end
|
102
|
+
|
83
103
|
# Get the status of a repository's branch.
|
84
104
|
get %r{\/([-_\.0-9a-zA-Z]+)\/([-_\+\.a-zA-z0-9\/]+)} do |repo_name, branch_name|
|
85
105
|
limit = params["limit"]
|
@@ -87,18 +107,7 @@ module Janky
|
|
87
107
|
repo = find_repo(repo_name)
|
88
108
|
branch = repo.branch_for(branch_name)
|
89
109
|
builds = branch.queued_builds.limit(limit).map do |build|
|
90
|
-
|
91
|
-
:repo => build.repo_name,
|
92
|
-
:branch => build.branch_name,
|
93
|
-
:user => build.user,
|
94
|
-
:green => build.green?,
|
95
|
-
:building => build.building?,
|
96
|
-
:queued => build.queued?,
|
97
|
-
:pending => build.pending?,
|
98
|
-
:number => build.number,
|
99
|
-
:status => (build.green? ? "was successful" : "failed"),
|
100
|
-
:compare => build.compare,
|
101
|
-
:duration => build.duration }
|
110
|
+
build_to_hash(build)
|
102
111
|
end
|
103
112
|
|
104
113
|
builds.to_json
|
@@ -117,11 +126,30 @@ ci set room janky development
|
|
117
126
|
ci status
|
118
127
|
ci status janky
|
119
128
|
ci status janky/master
|
129
|
+
ci builds limit [building]
|
120
130
|
EOS
|
121
131
|
end
|
122
132
|
|
123
133
|
get "/boomtown" do
|
124
134
|
fail "BOOM (janky)"
|
125
135
|
end
|
136
|
+
|
137
|
+
private
|
138
|
+
|
139
|
+
def build_to_hash(build)
|
140
|
+
{ :sha1 => build.sha1,
|
141
|
+
:repo => build.repo_name,
|
142
|
+
:branch => build.branch_name,
|
143
|
+
:user => build.user,
|
144
|
+
:green => build.green?,
|
145
|
+
:building => build.building?,
|
146
|
+
:queued => build.queued?,
|
147
|
+
:pending => build.pending?,
|
148
|
+
:number => build.number,
|
149
|
+
:status => (build.green? ? "was successful" : "failed"),
|
150
|
+
:compare => build.compare,
|
151
|
+
:duration => build.duration,
|
152
|
+
:web_url => build.web_url }
|
153
|
+
end
|
126
154
|
end
|
127
155
|
end
|
data/lib/janky/version.rb
CHANGED
data/test/janky_test.rb
CHANGED
@@ -262,6 +262,30 @@ class JankyTest < Test::Unit::TestCase
|
|
262
262
|
assert_equal 2, payload.size
|
263
263
|
end
|
264
264
|
|
265
|
+
test "hubot last 1 builds" do
|
266
|
+
3.times do
|
267
|
+
gh_post_receive("github", "master")
|
268
|
+
Janky::Builder.start!
|
269
|
+
Janky::Builder.complete!
|
270
|
+
end
|
271
|
+
|
272
|
+
assert_equal 1, Yajl.load(hubot_last(limit: 1).body).size
|
273
|
+
end
|
274
|
+
|
275
|
+
test "hubot lasts completed" do
|
276
|
+
gh_post_receive("github", "master")
|
277
|
+
Janky::Builder.start!
|
278
|
+
Janky::Builder.complete!
|
279
|
+
|
280
|
+
assert_equal 1, Yajl.load(hubot_last.body).size
|
281
|
+
end
|
282
|
+
|
283
|
+
test "hubot lasts building" do
|
284
|
+
gh_post_receive("github", "master")
|
285
|
+
Janky::Builder.start!
|
286
|
+
assert_equal 1, Yajl.load(hubot_last(building: true).body).size
|
287
|
+
end
|
288
|
+
|
265
289
|
test "hubot build" do
|
266
290
|
gh_post_receive("github", "master")
|
267
291
|
Janky::Builder.start!
|
data/test/test_helper.rb
CHANGED
@@ -110,6 +110,11 @@ class Test::Unit::TestCase
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
+
def hubot_last(options = {})
|
114
|
+
hubot_request "GET",
|
115
|
+
"/_hubot/builds?limit=#{options[:limit]}&building=#{options[:building]}"
|
116
|
+
end
|
117
|
+
|
113
118
|
def hubot_latest_build_sha(repo, branch)
|
114
119
|
response = hubot_status(repo, branch)
|
115
120
|
Yajl.load(response.body).first["sha1"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: janky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Rozet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -306,3 +306,4 @@ test_files:
|
|
306
306
|
- test/default.xml.erb
|
307
307
|
- test/janky_test.rb
|
308
308
|
- test/test_helper.rb
|
309
|
+
has_rdoc: false
|