webhookd 0.0.8 → 0.0.9
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/CHANGELOG.md +6 -1
- data/README.md +6 -1
- data/lib/webhookd/cli.rb +6 -1
- data/lib/webhookd/payloadtype/github-json.rb +40 -0
- data/lib/webhookd/version.rb +1 -1
- data/webhookd.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0069085f0f7d2d468afa68f40466ea6b278a38cd
|
4
|
+
data.tar.gz: e0945f696def8cd28cfb30819d31c4a421472dcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e90a7bdc1707a758d7e861a577d2bc099c8866b7544822b4cd013c388dba6c3a2ac4cb70e65f537eae5c65b4c47ae9e339559075f2160355cfed14f00aa24116
|
7
|
+
data.tar.gz: da68b333eb3eed0c94d41bb7a996172c05a925fcf523d950b7a99ec527c63b506c50c338db0f845f3b9025f5ef54ca2cbecf1f9a2924ed4d79f557345b79bd03
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -243,7 +243,12 @@ git-buildpackage -us -uc
|
|
243
243
|
|
244
244
|
If there is a new upstream version:
|
245
245
|
```
|
246
|
-
gem fetch webhookd && gem2deb webhookd*.gem
|
246
|
+
gem fetch webhookd && gem2deb webhookd*.gem
|
247
|
+
cd webhookd
|
248
|
+
git-import-orig ../webhookd-<VER>.tar.gz
|
247
249
|
dch -v <upstreamver>-<incrementpkgrel>
|
250
|
+
git commit -a
|
251
|
+
rm Gemfile.lock
|
252
|
+
git-buildpackage -us -uc
|
248
253
|
```
|
249
254
|
|
data/lib/webhookd/cli.rb
CHANGED
@@ -35,7 +35,12 @@ module Webhookd
|
|
35
35
|
def get_rackup_config
|
36
36
|
begin
|
37
37
|
spec = Gem::Specification.find_by_name('webhookd')
|
38
|
-
"#{spec.gem_dir}/config.ru"
|
38
|
+
fullpath = "#{spec.gem_dir}/config.ru"
|
39
|
+
if File.exist?(fullpath)
|
40
|
+
fullpath
|
41
|
+
else
|
42
|
+
raise Gem::LoadError
|
43
|
+
end
|
39
44
|
rescue Gem::LoadError
|
40
45
|
if File.exist?('/etc/webhookd/config.ru')
|
41
46
|
'/etc/webhookd/config.ru'
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'webhookd/logging'
|
2
|
+
module Webhookd
|
3
|
+
class ParsePayload
|
4
|
+
|
5
|
+
include Logging
|
6
|
+
|
7
|
+
def initialize(payload)
|
8
|
+
@payload = payload
|
9
|
+
end
|
10
|
+
|
11
|
+
def parse
|
12
|
+
require 'json'
|
13
|
+
logger.debug 'parsing payload type github-json'
|
14
|
+
|
15
|
+
json_parsed = JSON.parse(@payload)
|
16
|
+
logger.debug "raw received data: #{json_parsed}"
|
17
|
+
|
18
|
+
# loop through commits to find the author
|
19
|
+
author_name = '_notfound'
|
20
|
+
json_parsed['commits'].each do |commit|
|
21
|
+
if commit['author']
|
22
|
+
author_name = commit['author']['name']
|
23
|
+
break
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
data = Hash.new
|
28
|
+
data[:type] = 'vcs'
|
29
|
+
data[:source] = 'github'
|
30
|
+
data[:repo_name] = json_parsed['repository']['name']
|
31
|
+
data[:branch_name] = json_parsed['ref'].split("/")[2]
|
32
|
+
data[:author_name] = author_name
|
33
|
+
|
34
|
+
logger.info "parsed from the github-json data: #{data}"
|
35
|
+
|
36
|
+
# return the hash
|
37
|
+
data
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/webhookd/version.rb
CHANGED
data/webhookd.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.0'
|
23
23
|
spec.add_development_dependency 'rake', '~> 10.0'
|
24
24
|
spec.add_development_dependency 'rack-test', '>= 0.6.0'
|
25
25
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webhookd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Brunner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- lib/webhookd/logging.rb
|
141
141
|
- lib/webhookd/payloadtype/bitbucket.rb
|
142
142
|
- lib/webhookd/payloadtype/debug.rb
|
143
|
+
- lib/webhookd/payloadtype/github-json.rb
|
143
144
|
- lib/webhookd/payloadtype/gitlab.rb
|
144
145
|
- lib/webhookd/version.rb
|
145
146
|
- scripts/test/curl-bitbucket-explicit-repo-and-branch.sh
|