perkins 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -0
- data/.ruby-version +1 -0
- data/.vagrant/machines/default/virtualbox/action_provision +1 -0
- data/.vagrant/machines/default/virtualbox/action_set_name +1 -0
- data/.vagrant/machines/default/virtualbox/id +1 -0
- data/Gemfile +0 -1
- data/README.md +11 -4
- data/Rakefile +3 -2
- data/TODO.md +2 -2
- data/Vagrantfile +53 -0
- data/db/migrate/20150220143050_add_status_fields_to_repos.rb +11 -0
- data/db/schema.rb +3 -1
- data/examples/Gemfile +4 -0
- data/examples/Gemfile.lock +164 -0
- data/examples/Procfile +4 -0
- data/examples/boot.rb +15 -0
- data/examples/config.ru +22 -0
- data/examples/database.yml +2 -2
- data/examples/sidekiq.yml +9 -0
- data/lib/core_ext/string/color.rb +22 -0
- data/lib/perkins/application.rb +27 -3
- data/lib/perkins/assets/images/error.gif +0 -0
- data/lib/perkins/assets/images/working.gif +0 -0
- data/lib/perkins/assets/javascripts/app.js +17 -1
- data/lib/perkins/assets/javascripts/config.js.coffee +14 -0
- data/lib/perkins/assets/javascripts/log_view.js.coffee +1 -2
- data/lib/perkins/assets/javascripts/perkings.js.coffee +129 -20
- data/lib/perkins/assets/javascripts/perkins/helpers.js.coffee +21 -0
- data/lib/perkins/assets/javascripts/perkins/m/models.js.coffee +50 -0
- data/lib/perkins/assets/javascripts/perkins/router.js.coffee +10 -0
- data/lib/perkins/assets/javascripts/perkins/v/dashboard.js.coffee +17 -0
- data/lib/perkins/assets/javascripts/perkins/v/err.js.coffee +12 -0
- data/lib/perkins/assets/javascripts/perkins/v/menu.js.coffee +10 -0
- data/lib/perkins/assets/javascripts/perkins/v/my_repos.js.coffee +41 -0
- data/lib/perkins/assets/javascripts/perkins/v/orgs.js.coffee +39 -0
- data/lib/perkins/assets/javascripts/perkins/v/profile.js.coffee +20 -0
- data/lib/perkins/assets/javascripts/perkins/v/repo.js.coffee +192 -0
- data/lib/perkins/assets/javascripts/perkins/v/sidebar.js.coffee +33 -0
- data/lib/perkins/assets/javascripts/templates/dashboard.hamlc +11 -0
- data/lib/perkins/assets/javascripts/templates/error.hamlc +22 -0
- data/lib/perkins/assets/javascripts/templates/menu.hamlc +18 -0
- data/lib/perkins/assets/javascripts/templates/org.hamlc +77 -0
- data/lib/perkins/assets/javascripts/templates/profile.hamlc +28 -0
- data/lib/perkins/assets/javascripts/templates/repo.hamlc +37 -0
- data/lib/perkins/assets/javascripts/templates/repos/build_row.hamlc +19 -0
- data/lib/perkins/assets/javascripts/templates/repos/builds.hamlc +25 -0
- data/lib/perkins/assets/javascripts/templates/repos/config.hamlc +77 -0
- data/lib/perkins/assets/javascripts/templates/repos/gb_repo.hamlc +31 -0
- data/lib/perkins/assets/javascripts/templates/repos/github.hamlc +7 -0
- data/lib/perkins/assets/javascripts/templates/repos/menu.hamlc +17 -0
- data/lib/perkins/assets/javascripts/templates/repos/report_detail.hamlc +53 -0
- data/lib/perkins/assets/javascripts/templates/sidebar.hamlc +14 -0
- data/lib/perkins/assets/javascripts/templates/sidebar_repo.hamlc +4 -0
- data/lib/perkins/assets/javascripts/vendor/backbone-min.js +2 -0
- data/lib/perkins/assets/javascripts/vendor/backbone.marionette.js +2891 -0
- data/lib/perkins/assets/javascripts/vendor/hamlcoffee.js.coffee.erb +138 -0
- data/lib/perkins/assets/javascripts/vendor/livequery.jquery.js +8 -0
- data/lib/perkins/assets/javascripts/vendor/log.js +1 -1
- data/lib/perkins/assets/javascripts/vendor/md5.js +207 -0
- data/lib/perkins/assets/javascripts/vendor/nprogress.js +476 -0
- data/lib/perkins/assets/javascripts/vendor/underscore.js +6 -0
- data/lib/perkins/assets/stylesheets/app.css +3 -0
- data/lib/perkins/assets/stylesheets/bootstrap-overrides.css.scss +13 -0
- data/lib/perkins/assets/stylesheets/styles.css.scss +30 -3
- data/lib/perkins/assets/stylesheets/vendor/nprogress.css +74 -0
- data/lib/perkins/assets.rb +42 -0
- data/lib/perkins/build/script/ruby.rb +1 -1
- data/lib/perkins/build_report.rb +13 -0
- data/lib/perkins/{worker.rb → build_worker.rb} +9 -5
- data/lib/perkins/cli.rb +4 -2
- data/lib/perkins/commit.rb +8 -1
- data/lib/perkins/git_loader_worker.rb +29 -0
- data/lib/perkins/repo.rb +23 -9
- data/lib/perkins/runner.rb +16 -25
- data/lib/perkins/server.rb +121 -116
- data/lib/perkins/version.rb +1 -1
- data/lib/perkins/views/builds.haml +0 -3
- data/lib/perkins/views/layout.haml +25 -36
- data/lib/perkins/views/menu.haml +1 -1
- data/lib/perkins/views/repos/github.haml +0 -31
- data/lib/perkins/views/repos/repo.haml +1 -1
- data/lib/perkins.rb +4 -2
- data/perkins.gemspec +5 -2
- data/spec/lib/repo_spec.rb +27 -6
- data/spec/lib/runner_spec.rb +1 -0
- data/spec/lib/server_spec.rb +6 -23
- data/spec/spec_helper.rb +14 -3
- metadata +160 -70
- data/examples/config.rb +0 -12
- data/examples/mongo.yml +0 -13
- data/lib/perkins/listener.rb +0 -38
- data/spec/lib/listener_spec.rb +0 -30
data/examples/mongo.yml
DELETED
data/lib/perkins/listener.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
|
2
|
-
module Perkins
|
3
|
-
|
4
|
-
#this should be a daemon
|
5
|
-
#it will listen incoming messages
|
6
|
-
#it will run the propper repo with runner commands
|
7
|
-
#it will pass the message to other daemon to notify
|
8
|
-
#it will deploy ?
|
9
|
-
|
10
|
-
class Listener
|
11
|
-
|
12
|
-
attr_accessor :app
|
13
|
-
|
14
|
-
def run!
|
15
|
-
#chan't use the same $redis conn because it fails
|
16
|
-
#TODO: reconnect with same settings
|
17
|
-
redis_conn = Redis.new()
|
18
|
-
redis_conn.subscribe('perkins:commits') do |on|
|
19
|
-
on.message do |channel, msg|
|
20
|
-
exec_runner(channel, msg)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def exec_runner(channel, msg)
|
26
|
-
data = JSON.parse(msg)
|
27
|
-
puts "##{channel} - [#{data['name']}]: #{data['sha']}"
|
28
|
-
|
29
|
-
repo = Perkins::Repo.find(data["id"])
|
30
|
-
|
31
|
-
#Thread.new do
|
32
|
-
Worker.perform(repo, data['sha'], data['branch'] )
|
33
|
-
#end
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
data/spec/lib/listener_spec.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '../../spec_helper')
|
2
|
-
|
3
|
-
require "perkins/dsl"
|
4
|
-
|
5
|
-
describe "Listener" do
|
6
|
-
|
7
|
-
let(:app){
|
8
|
-
Perkins.application() do |app|
|
9
|
-
app.redis = Redis.new
|
10
|
-
app.server = { host: "localhost", port:1234 }
|
11
|
-
end
|
12
|
-
}
|
13
|
-
|
14
|
-
context "runner config" do
|
15
|
-
|
16
|
-
it "should generate a redis build data" do
|
17
|
-
data = {name: "lazy_high_charts" , sha: "2eed41547227ac03113613a54e8d7305fce982f0"}.to_json
|
18
|
-
l = Perkins::Listener.new
|
19
|
-
l.app = app
|
20
|
-
$redis.flushdb
|
21
|
-
allow(Perkins::Repo).to receive(:find).and_return(true)
|
22
|
-
allow(Perkins::Worker).to receive(:perform).and_return(true)
|
23
|
-
|
24
|
-
#expect(l).to receive(:exec_runner).with("commits", data)
|
25
|
-
l.exec_runner("commits", data)
|
26
|
-
expect(Perkins::Worker).to have_received(:perform)
|
27
|
-
r = Perkins::Repo.create
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|