perkins 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/TODO.md +2 -2
- data/examples/Gemfile +1 -1
- data/examples/Gemfile.lock +30 -23
- data/examples/Procfile +2 -1
- data/examples/config.ru +6 -0
- data/examples/rainbows.rb +5 -0
- data/examples/rakefile +4 -0
- data/lib/perkins/application.rb +18 -4
- data/lib/perkins/assets/javascripts/perkins/helpers.js.coffee +1 -1
- data/lib/perkins/build_report.rb +33 -0
- data/lib/perkins/build_worker.rb +2 -0
- data/lib/perkins/repo.rb +2 -0
- data/lib/perkins/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45570213f70cf7ea0b87581baced671d022d2bb4
|
4
|
+
data.tar.gz: 974641b152db25e612ef63370f9f3e450c4e0b4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f72e7ec3b748f44f04ff3419775f8695e456a54fc0ccb3b9552a5ef96af4c14d085e0821e2ef88ce5ecd5dce9f003560b2953031310ff07e76f2a0b9fec331a7
|
7
|
+
data.tar.gz: d94c351caebcb5796a210ea2ac4af9ba808bc771e0c351a2f588aaa81a67eea95916ef719aaf464688ab0e208a3176d5cc2729135f0d1677656199eec5bb221e
|
data/.gitignore
CHANGED
data/TODO.md
CHANGED
data/examples/Gemfile
CHANGED
data/examples/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
perkins (0.0.
|
4
|
+
perkins (0.0.2)
|
5
5
|
activerecord (>= 3, < 4.1)
|
6
6
|
activesupport (>= 3, < 4.1)
|
7
7
|
celluloid
|
@@ -45,7 +45,7 @@ GEM
|
|
45
45
|
multi_json (~> 1.3)
|
46
46
|
thread_safe (~> 0.1)
|
47
47
|
tzinfo (~> 0.3.37)
|
48
|
-
addressable (2.3.
|
48
|
+
addressable (2.3.8)
|
49
49
|
arel (4.0.2)
|
50
50
|
backports (3.6.4)
|
51
51
|
builder (3.1.4)
|
@@ -55,17 +55,17 @@ GEM
|
|
55
55
|
celluloid (>= 0.16.0)
|
56
56
|
nio4r (>= 1.1.0)
|
57
57
|
coderay (1.1.0)
|
58
|
-
coffee-script (2.
|
58
|
+
coffee-script (2.4.1)
|
59
59
|
coffee-script-source
|
60
60
|
execjs
|
61
|
-
coffee-script-source (1.9.1)
|
62
|
-
connection_pool (2.
|
61
|
+
coffee-script-source (1.9.1.1)
|
62
|
+
connection_pool (2.2.0)
|
63
63
|
daemons (1.1.9)
|
64
|
-
dotenv (
|
65
|
-
dotenv-rails (
|
66
|
-
dotenv (=
|
64
|
+
dotenv (2.0.1)
|
65
|
+
dotenv-rails (2.0.1)
|
66
|
+
dotenv (= 2.0.1)
|
67
67
|
eventmachine (1.0.7)
|
68
|
-
execjs (2.
|
68
|
+
execjs (2.5.2)
|
69
69
|
faraday (0.9.1)
|
70
70
|
multipart-post (>= 1.2, < 3)
|
71
71
|
git (1.2.9.1)
|
@@ -78,11 +78,11 @@ GEM
|
|
78
78
|
hike (1.2.3)
|
79
79
|
hitimes (1.2.2)
|
80
80
|
i18n (0.7.0)
|
81
|
-
json (1.8.
|
81
|
+
json (1.8.3)
|
82
82
|
kgio (2.9.3)
|
83
83
|
method_source (0.8.2)
|
84
84
|
minitest (4.7.5)
|
85
|
-
multi_json (1.
|
85
|
+
multi_json (1.11.2)
|
86
86
|
multipart-post (2.0.0)
|
87
87
|
nio4r (1.1.0)
|
88
88
|
octokit (3.8.0)
|
@@ -96,25 +96,29 @@ GEM
|
|
96
96
|
rack
|
97
97
|
rack-test (0.6.3)
|
98
98
|
rack (>= 1.0)
|
99
|
+
rainbows (4.6.2)
|
100
|
+
kgio (~> 2.5)
|
101
|
+
rack (~> 1.1)
|
102
|
+
unicorn (~> 4.8)
|
99
103
|
raindrops (0.13.0)
|
100
104
|
rdiscount (2.1.8)
|
101
105
|
redis (3.2.1)
|
102
|
-
redis-namespace (1.5.
|
106
|
+
redis-namespace (1.5.2)
|
103
107
|
redis (~> 3.0, >= 3.0.4)
|
104
|
-
sass (3.4.
|
108
|
+
sass (3.4.16)
|
105
109
|
sawyer (0.6.0)
|
106
110
|
addressable (~> 2.3.5)
|
107
111
|
faraday (~> 0.8, < 0.10)
|
108
|
-
sidekiq (3.
|
109
|
-
celluloid (
|
110
|
-
connection_pool (>= 2.
|
111
|
-
json
|
112
|
-
redis (>= 3.
|
113
|
-
redis-namespace (>= 1.
|
114
|
-
sinatra (1.4.
|
112
|
+
sidekiq (3.4.2)
|
113
|
+
celluloid (~> 0.16.0)
|
114
|
+
connection_pool (~> 2.2, >= 2.2.0)
|
115
|
+
json (~> 1.0)
|
116
|
+
redis (~> 3.2, >= 3.2.1)
|
117
|
+
redis-namespace (~> 1.5, >= 1.5.2)
|
118
|
+
sinatra (1.4.6)
|
115
119
|
rack (~> 1.4)
|
116
120
|
rack-protection (~> 1.4)
|
117
|
-
tilt (
|
121
|
+
tilt (>= 1.3, < 3)
|
118
122
|
sinatra-activerecord (2.0.5)
|
119
123
|
activerecord (>= 3.2)
|
120
124
|
sinatra (~> 1.0)
|
@@ -137,7 +141,7 @@ GEM
|
|
137
141
|
eventmachine (~> 1.0)
|
138
142
|
rack (~> 1.0)
|
139
143
|
thor (0.19.1)
|
140
|
-
thread_safe (0.3.
|
144
|
+
thread_safe (0.3.5)
|
141
145
|
tilt (1.4.1)
|
142
146
|
timers (4.0.1)
|
143
147
|
hitimes
|
@@ -161,4 +165,7 @@ PLATFORMS
|
|
161
165
|
DEPENDENCIES
|
162
166
|
perkins!
|
163
167
|
pry
|
164
|
-
|
168
|
+
rainbows
|
169
|
+
|
170
|
+
BUNDLED WITH
|
171
|
+
1.10.5
|
data/examples/Procfile
CHANGED
data/examples/config.ru
CHANGED
@@ -3,6 +3,8 @@ require "./boot"
|
|
3
3
|
|
4
4
|
require 'sidekiq/web'
|
5
5
|
|
6
|
+
require 'rack/protection'
|
7
|
+
|
6
8
|
#\ -o 0.0.0.0 -w -p 3000
|
7
9
|
|
8
10
|
#worker_processes 3
|
@@ -14,6 +16,10 @@ map '/' do
|
|
14
16
|
end
|
15
17
|
|
16
18
|
map '/sidekiq' do
|
19
|
+
use Rack::Session::Pool, :key => 'session_id'
|
20
|
+
use Rack::Protection
|
21
|
+
use Rack::Protection::AuthenticityToken
|
22
|
+
|
17
23
|
use Rack::Auth::Basic, "Protected Area" do |username, password|
|
18
24
|
username == 'sidekiq' && password == 'sidekiq'
|
19
25
|
end
|
data/examples/rakefile
ADDED
data/lib/perkins/application.rb
CHANGED
@@ -9,12 +9,13 @@ module Perkins
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def initialize(opts={})
|
12
|
-
host = opts[:host] unless opts[:host].blank?
|
13
|
-
post = opts[:port] unless opts[:port].blank?
|
14
|
-
github_client_id = opts[:github_client_id] unless opts[:github_client_id].blank?
|
15
|
-
github_client_server = opts[:github_client_secret] unless opts[:github_client_secret].blank?
|
12
|
+
@host = opts[:host] unless opts[:host].blank?
|
13
|
+
@post = opts[:port] unless opts[:port].blank?
|
14
|
+
@github_client_id = opts[:github_client_id] unless opts[:github_client_id].blank?
|
15
|
+
@github_client_server = opts[:github_client_secret] unless opts[:github_client_secret].blank?
|
16
16
|
working_dir = opts[:working_dir] unless opts[:working_dir].blank?
|
17
17
|
self.class.instance = self
|
18
|
+
self.init_github_client
|
18
19
|
self
|
19
20
|
end
|
20
21
|
|
@@ -28,6 +29,19 @@ module Perkins
|
|
28
29
|
@db
|
29
30
|
end
|
30
31
|
|
32
|
+
def init_github_client
|
33
|
+
#$github_client = Octokit::Client.new \
|
34
|
+
# :client_id => @github_client_id,
|
35
|
+
# :client_secret => @github_client_server
|
36
|
+
|
37
|
+
#GLOBAL SERVER 2 SERVER GITHUB CLIENT
|
38
|
+
$github_client ||= Octokit::Client.new(
|
39
|
+
login: ENV['LOGIN'],
|
40
|
+
access_token: ENV['ACCESS_TOKEN']
|
41
|
+
)
|
42
|
+
|
43
|
+
end
|
44
|
+
|
31
45
|
def redis=(opts={})
|
32
46
|
namespace = opts.delete(:namespace) || :perkins
|
33
47
|
redis_connection = Redis.new(opts)
|
@@ -5,7 +5,7 @@ Perkins.Helpers.gravatar_url = (email, size) ->
|
|
5
5
|
"http://gravatar.com/avatar/#{gravatar_id}.png?s=#{size}"
|
6
6
|
|
7
7
|
Perkins.Helpers.commit_url = (repo, sha) ->
|
8
|
-
"#{repo.http_url}/commit/#{sha}"
|
8
|
+
"#{repo.repo.http_url}/commit/#{sha}"
|
9
9
|
|
10
10
|
Perkins.Helpers.status_label = (status)->
|
11
11
|
label = if status == true then "success" else "default"
|
data/lib/perkins/build_report.rb
CHANGED
@@ -7,6 +7,11 @@ module Perkins
|
|
7
7
|
@commit ||= Perkins::Commit.new(self.sha, self.repo)
|
8
8
|
end
|
9
9
|
|
10
|
+
def send_github_status(sha)
|
11
|
+
self.repo.git
|
12
|
+
self.build_status_report(sha)
|
13
|
+
end
|
14
|
+
|
10
15
|
def as_json(options = {})
|
11
16
|
data = {}
|
12
17
|
|
@@ -20,5 +25,33 @@ module Perkins
|
|
20
25
|
data
|
21
26
|
end
|
22
27
|
|
28
|
+
|
29
|
+
|
30
|
+
# Status report to GITHUB repo
|
31
|
+
|
32
|
+
def build_status_report(sha)
|
33
|
+
$github_client.create_status(
|
34
|
+
self.repo.name, sha,
|
35
|
+
github_state,
|
36
|
+
{ context: "Perkins CI",
|
37
|
+
description: github_state_description ,
|
38
|
+
target_url: github_state_url
|
39
|
+
}
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
def github_state
|
44
|
+
self.status ? "success" : "failure"
|
45
|
+
end
|
46
|
+
|
47
|
+
def github_state_description
|
48
|
+
d = "- The Perkins CI build"
|
49
|
+
d = self.status ? "passed" : "fail"
|
50
|
+
end
|
51
|
+
|
52
|
+
def github_state_url
|
53
|
+
"#{Perkins::Application.instance.sse_endpoint}/repos/#{repo.name}/builds/#{self.id}"
|
54
|
+
end
|
55
|
+
|
23
56
|
end
|
24
57
|
end
|
data/lib/perkins/build_worker.rb
CHANGED
data/lib/perkins/repo.rb
CHANGED
data/lib/perkins/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perkins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- miguel michelson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -434,6 +434,8 @@ files:
|
|
434
434
|
- examples/boot.rb
|
435
435
|
- examples/config.ru
|
436
436
|
- examples/database.yml
|
437
|
+
- examples/rainbows.rb
|
438
|
+
- examples/rakefile
|
437
439
|
- examples/sidekiq.yml
|
438
440
|
- lib/core_ext/hash/compact.rb
|
439
441
|
- lib/core_ext/hash/deep_merge.rb
|
@@ -575,7 +577,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
575
577
|
version: '0'
|
576
578
|
requirements: []
|
577
579
|
rubyforge_project:
|
578
|
-
rubygems_version: 2.4.
|
580
|
+
rubygems_version: 2.4.8
|
579
581
|
signing_key:
|
580
582
|
specification_version: 4
|
581
583
|
summary: A travis compatible standalone CI solution for ruby
|