pkg-wizard 0.1.26 → 0.1.27

Sign up to get free protection for your applications and to get access to all the features.
@@ -40,10 +40,10 @@ module PKGWizard
40
40
  end
41
41
 
42
42
  def self.run
43
- wslogview_dir = 'wslogview'
43
+ public_dir = 'public'
44
44
  if not defined? @@proc
45
45
  puts '* starting NODE.JS...'
46
- @@proc = IO.popen("node wslogview/server.js #{@@logfile}")
46
+ @@proc = IO.popen("node public/server.js #{@@logfile}")
47
47
  end
48
48
  end
49
49
  end
@@ -93,6 +93,10 @@ module PKGWizard
93
93
  (Dir["failed/job_*"] + Dir["success/job_*"]).find { |j| File.basename(j) == name }
94
94
  end
95
95
 
96
+ get '/' do
97
+ File.read(File.join(File.dirname(__FILE__), '/../../../resources/public/build-bot/index.html'))
98
+ end
99
+
96
100
  post '/tag/:name' do
97
101
  name = params[:name]
98
102
  if name.nil? or name.strip.chomp.empty?
@@ -115,11 +119,14 @@ module PKGWizard
115
119
  end
116
120
 
117
121
  post '/job/clean' do
118
- dir = params[:dir] || 'output'
122
+ dir = params[:dir]
119
123
  if dir == 'output'
120
124
  FileUtils.touch 'output/.clean'
121
125
  elsif dir == 'failed'
122
126
  FileUtils.touch 'failed/.clean'
127
+ elsif dir.nil?
128
+ FileUtils.touch 'output/.clean'
129
+ FileUtils.touch 'failed/.clean'
123
130
  else
124
131
  $stderr.puts "WARNING: job/clean Unknown dir #{dir}. Ignoring."
125
132
  end
@@ -143,7 +150,7 @@ module PKGWizard
143
150
  if NodeRunner.available?
144
151
  NodeRunner.run
145
152
  sleep 0.5
146
- index = 'wslogview/index.html'
153
+ index = 'public/index.html'
147
154
  File.read index
148
155
  else
149
156
  'node.js is not installed: Real time logs disabled :('
@@ -268,17 +275,18 @@ module PKGWizard
268
275
  cli.parse_options
269
276
 
270
277
  ## Node.JS log server stuff
271
- wslogview_dir = File.join(File.dirname(__FILE__), '/../../../resources/wslogview/')
278
+ public_dir = File.join(File.dirname(__FILE__), '/../../../resources/public/')
272
279
  node_port = cli.config[:log_server_port]
273
- if not File.exist?('wslogview')
274
- FileUtils.cp_r wslogview_dir, 'wslogview'
280
+ if File.exist?('public')
281
+ FileUtils.rm_rf 'public'
275
282
  end
276
- html = File.read('wslogview/index.html.tmpl').gsub('@@NODEJSPORT@@', node_port)
277
- serverjs = File.read('wslogview/server.js.tmpl').gsub('@@NODEJSPORT@@', node_port)
278
- File.open 'wslogview/index.html', 'w' do |f|
283
+ FileUtils.cp_r public_dir, 'public'
284
+ html = File.read('public/index.html.tmpl').gsub('@@NODEJSPORT@@', node_port)
285
+ serverjs = File.read('public/server.js.tmpl').gsub('@@NODEJSPORT@@', node_port)
286
+ File.open 'public/index.html', 'w' do |f|
279
287
  f.puts html
280
288
  end
281
- File.open 'wslogview/server.js', 'w' do |f|
289
+ File.open 'public/server.js', 'w' do |f|
282
290
  f.puts serverjs
283
291
  end
284
292
 
@@ -471,7 +479,7 @@ module PKGWizard
471
479
  end
472
480
  end
473
481
  Webapp.set :port => cli.config[:port]
474
- Webapp.set :public => 'wslogview'
482
+ Webapp.set :public => 'public'
475
483
  Webapp.run!
476
484
  at_exit do
477
485
  NodeRunner.kill
data/lib/pkg-wizard.rb CHANGED
@@ -4,7 +4,7 @@ require 'mixlib/cli'
4
4
 
5
5
  module PKGWizard
6
6
 
7
- VERSION = '0.1.26'
7
+ VERSION = '0.1.27'
8
8
 
9
9
  class Distribution
10
10
  def self.detect
@@ -51,7 +51,6 @@ stop() {
51
51
  }
52
52
 
53
53
  restart() {
54
- configtest_q || configtest || return 6
55
54
  stop
56
55
  start
57
56
  }
@@ -0,0 +1,14 @@
1
+ <html style="background: url(/images/background.png) bottom left repeat;">
2
+ <head>
3
+ <title>
4
+ Pkg Wizard's Build Bot
5
+ </title>
6
+ </head>
7
+
8
+ <body>
9
+ <center>
10
+
11
+ <img style="margin-top: 80px" src="/images/pkg-wizard-logo.png"/>
12
+ </center>
13
+ </body>
14
+ </html>
@@ -12,7 +12,7 @@
12
12
  var conn;
13
13
  var connect = function() {
14
14
  if (window["WebSocket"]) {
15
- conn = new WebSocket('ws://' + location.hostname + ':@@NODEJSPORT@@');
15
+ conn = new WebSocket('ws://' + location.hostname + ':60001');
16
16
  conn.onmessage = function(evt) {
17
17
  data = $.parseJSON(evt.data);
18
18
 
@@ -31,13 +31,14 @@ window.onload = connect;
31
31
 
32
32
  </script>
33
33
 
34
- <center><span class="header">BUILD BOT LOGS</span></center>
35
- <br/>
36
- <br/>
37
-
34
+ <div class='header'>
35
+ <div>
36
+ <img src="images/pkg-wizard-logo-small.png"/>
37
+ </div>
38
+ <div> logs </div>
39
+ </div>
38
40
  <div id="buildbot" class="log">
39
41
  </div>
40
-
41
42
  </body>
42
43
 
43
44
  </html>
@@ -0,0 +1,47 @@
1
+ <html>
2
+ <head>
3
+ <title>Pkg Wizard's Build Bot</title>
4
+ </head>
5
+ <body>
6
+ <link href='/screen.css' rel='stylesheet' type='text/css' />
7
+
8
+ <script src='/jquery.js'></script>
9
+
10
+ <script>
11
+
12
+ var conn;
13
+ var connect = function() {
14
+ if (window["WebSocket"]) {
15
+ conn = new WebSocket('ws://' + location.hostname + ':@@NODEJSPORT@@');
16
+ conn.onmessage = function(evt) {
17
+ data = $.parseJSON(evt.data);
18
+
19
+ if(data.buildbot != null) {
20
+ $('#buildbot').append("<div class=logline>" + unescape(data.buildbot) + "</div>");
21
+ }
22
+ x = 0; //horizontal coord
23
+ y = document.height; //vertical coord
24
+ window.scroll(x,y);
25
+
26
+ };
27
+ }
28
+ };
29
+
30
+ window.onload = connect;
31
+
32
+ </script>
33
+
34
+ <div class='header'>
35
+ <div>
36
+ <img src="images/pkg-wizard-logo-small.png"/>
37
+ </div>
38
+ <div> build-bot logs </div>
39
+ </div>
40
+ <center style='padding-top: 20px;'>
41
+ <div id="buildbot" class="log">
42
+ </div>
43
+ </center>
44
+ </body>
45
+
46
+
47
+ </html>
File without changes
@@ -0,0 +1,35 @@
1
+ html {
2
+ color: #fff;
3
+ background: url(/images/background.png) bottom left repeat;
4
+ }
5
+
6
+ .header {
7
+ font-weight: bold; font-size: 18px; text-shadow: 0px -1px 0px #000;
8
+ font-family: 'monospace';
9
+ text-align: center;
10
+ }
11
+
12
+ title {
13
+ }
14
+
15
+ .log {
16
+ color: white;
17
+ background-color: #000;
18
+ font-size: small;
19
+ font-family: 'monospace';
20
+ width: 80%;
21
+ padding: 10px;
22
+ -moz-border-radius: 5px;
23
+ -webkit-border-radius: 5px;
24
+ border-radius: 5px;
25
+ }
26
+
27
+ .logline {
28
+ text-align: left;
29
+ padding-top: 4px;
30
+ }
31
+
32
+ .logline:hover {
33
+ background-color: red;
34
+ color: white;
35
+ }
File without changes
File without changes
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkg-wizard
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 45
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 26
10
- version: 0.1.26
9
+ - 27
10
+ version: 0.1.27
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sergio Rubio
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-12 00:00:00 +02:00
18
+ date: 2011-04-13 00:00:00 +02:00
19
19
  default_executable: pkgwiz
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -219,11 +219,16 @@ files:
219
219
  - packages/rbel5-release-1.0-1.el5.noarch.rpm
220
220
  - packages/rbel6-release-1.0-1.el6.noarch.rpm
221
221
  - resources/init-scripts/pkgwiz-buildbot
222
- - resources/wslogview/index.html.tmpl
223
- - resources/wslogview/jquery.js
224
- - resources/wslogview/screen.css
225
- - resources/wslogview/server.js.tmpl
226
- - resources/wslogview/ws.js
222
+ - resources/public/build-bot/index.html
223
+ - resources/public/images/background.png
224
+ - resources/public/images/pkg-wizard-logo-small.png
225
+ - resources/public/images/pkg-wizard-logo.png
226
+ - resources/public/index.html
227
+ - resources/public/index.html.tmpl
228
+ - resources/public/jquery.js
229
+ - resources/public/screen.css
230
+ - resources/public/server.js.tmpl
231
+ - resources/public/ws.js
227
232
  has_rdoc: true
228
233
  homepage: http://github.com/rubiojr/pkg-wizard
229
234
  licenses:
@@ -1,26 +0,0 @@
1
- html {
2
- background-color: #000;
3
- color: #fff;
4
- }
5
-
6
- .header {
7
- font-weight: bold;
8
- text-align: center;
9
- font-size: 25px;
10
- }
11
-
12
- .log {
13
- color: white;
14
- background-color: #000;
15
- font-size: small;
16
- font-family: 'monospace';
17
- }
18
-
19
- .logline {
20
- padding-top: 4px;
21
- }
22
-
23
- .logline:hover {
24
- background-color: red;
25
- color: white;
26
- }