perkins 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -0
  3. data/.ruby-version +1 -0
  4. data/.vagrant/machines/default/virtualbox/action_provision +1 -0
  5. data/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  6. data/.vagrant/machines/default/virtualbox/id +1 -0
  7. data/Gemfile +0 -1
  8. data/README.md +11 -4
  9. data/Rakefile +3 -2
  10. data/TODO.md +2 -2
  11. data/Vagrantfile +53 -0
  12. data/db/migrate/20150220143050_add_status_fields_to_repos.rb +11 -0
  13. data/db/schema.rb +3 -1
  14. data/examples/Gemfile +4 -0
  15. data/examples/Gemfile.lock +164 -0
  16. data/examples/Procfile +4 -0
  17. data/examples/boot.rb +15 -0
  18. data/examples/config.ru +22 -0
  19. data/examples/database.yml +2 -2
  20. data/examples/sidekiq.yml +9 -0
  21. data/lib/core_ext/string/color.rb +22 -0
  22. data/lib/perkins/application.rb +27 -3
  23. data/lib/perkins/assets/images/error.gif +0 -0
  24. data/lib/perkins/assets/images/working.gif +0 -0
  25. data/lib/perkins/assets/javascripts/app.js +17 -1
  26. data/lib/perkins/assets/javascripts/config.js.coffee +14 -0
  27. data/lib/perkins/assets/javascripts/log_view.js.coffee +1 -2
  28. data/lib/perkins/assets/javascripts/perkings.js.coffee +129 -20
  29. data/lib/perkins/assets/javascripts/perkins/helpers.js.coffee +21 -0
  30. data/lib/perkins/assets/javascripts/perkins/m/models.js.coffee +50 -0
  31. data/lib/perkins/assets/javascripts/perkins/router.js.coffee +10 -0
  32. data/lib/perkins/assets/javascripts/perkins/v/dashboard.js.coffee +17 -0
  33. data/lib/perkins/assets/javascripts/perkins/v/err.js.coffee +12 -0
  34. data/lib/perkins/assets/javascripts/perkins/v/menu.js.coffee +10 -0
  35. data/lib/perkins/assets/javascripts/perkins/v/my_repos.js.coffee +41 -0
  36. data/lib/perkins/assets/javascripts/perkins/v/orgs.js.coffee +39 -0
  37. data/lib/perkins/assets/javascripts/perkins/v/profile.js.coffee +20 -0
  38. data/lib/perkins/assets/javascripts/perkins/v/repo.js.coffee +192 -0
  39. data/lib/perkins/assets/javascripts/perkins/v/sidebar.js.coffee +33 -0
  40. data/lib/perkins/assets/javascripts/templates/dashboard.hamlc +11 -0
  41. data/lib/perkins/assets/javascripts/templates/error.hamlc +22 -0
  42. data/lib/perkins/assets/javascripts/templates/menu.hamlc +18 -0
  43. data/lib/perkins/assets/javascripts/templates/org.hamlc +77 -0
  44. data/lib/perkins/assets/javascripts/templates/profile.hamlc +28 -0
  45. data/lib/perkins/assets/javascripts/templates/repo.hamlc +37 -0
  46. data/lib/perkins/assets/javascripts/templates/repos/build_row.hamlc +19 -0
  47. data/lib/perkins/assets/javascripts/templates/repos/builds.hamlc +25 -0
  48. data/lib/perkins/assets/javascripts/templates/repos/config.hamlc +77 -0
  49. data/lib/perkins/assets/javascripts/templates/repos/gb_repo.hamlc +31 -0
  50. data/lib/perkins/assets/javascripts/templates/repos/github.hamlc +7 -0
  51. data/lib/perkins/assets/javascripts/templates/repos/menu.hamlc +17 -0
  52. data/lib/perkins/assets/javascripts/templates/repos/report_detail.hamlc +53 -0
  53. data/lib/perkins/assets/javascripts/templates/sidebar.hamlc +14 -0
  54. data/lib/perkins/assets/javascripts/templates/sidebar_repo.hamlc +4 -0
  55. data/lib/perkins/assets/javascripts/vendor/backbone-min.js +2 -0
  56. data/lib/perkins/assets/javascripts/vendor/backbone.marionette.js +2891 -0
  57. data/lib/perkins/assets/javascripts/vendor/hamlcoffee.js.coffee.erb +138 -0
  58. data/lib/perkins/assets/javascripts/vendor/livequery.jquery.js +8 -0
  59. data/lib/perkins/assets/javascripts/vendor/log.js +1 -1
  60. data/lib/perkins/assets/javascripts/vendor/md5.js +207 -0
  61. data/lib/perkins/assets/javascripts/vendor/nprogress.js +476 -0
  62. data/lib/perkins/assets/javascripts/vendor/underscore.js +6 -0
  63. data/lib/perkins/assets/stylesheets/app.css +3 -0
  64. data/lib/perkins/assets/stylesheets/bootstrap-overrides.css.scss +13 -0
  65. data/lib/perkins/assets/stylesheets/styles.css.scss +30 -3
  66. data/lib/perkins/assets/stylesheets/vendor/nprogress.css +74 -0
  67. data/lib/perkins/assets.rb +42 -0
  68. data/lib/perkins/build/script/ruby.rb +1 -1
  69. data/lib/perkins/build_report.rb +13 -0
  70. data/lib/perkins/{worker.rb → build_worker.rb} +9 -5
  71. data/lib/perkins/cli.rb +4 -2
  72. data/lib/perkins/commit.rb +8 -1
  73. data/lib/perkins/git_loader_worker.rb +29 -0
  74. data/lib/perkins/repo.rb +23 -9
  75. data/lib/perkins/runner.rb +16 -25
  76. data/lib/perkins/server.rb +121 -116
  77. data/lib/perkins/version.rb +1 -1
  78. data/lib/perkins/views/builds.haml +0 -3
  79. data/lib/perkins/views/layout.haml +25 -36
  80. data/lib/perkins/views/menu.haml +1 -1
  81. data/lib/perkins/views/repos/github.haml +0 -31
  82. data/lib/perkins/views/repos/repo.haml +1 -1
  83. data/lib/perkins.rb +4 -2
  84. data/perkins.gemspec +5 -2
  85. data/spec/lib/repo_spec.rb +27 -6
  86. data/spec/lib/runner_spec.rb +1 -0
  87. data/spec/lib/server_spec.rb +6 -23
  88. data/spec/spec_helper.rb +14 -3
  89. metadata +160 -70
  90. data/examples/config.rb +0 -12
  91. data/examples/mongo.yml +0 -13
  92. data/lib/perkins/listener.rb +0 -38
  93. data/spec/lib/listener_spec.rb +0 -30
data/examples/mongo.yml DELETED
@@ -1,13 +0,0 @@
1
- development:
2
- sessions:
3
- default:
4
- database: perkins-dev
5
- hosts:
6
- - localhost:27017
7
-
8
- test:
9
- sessions:
10
- default:
11
- database: perkins-test
12
- hosts:
13
- - localhost:27017
@@ -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
@@ -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