vulcan 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/vulcan/cli.rb +1 -1
- data/lib/vulcan/version.rb +1 -1
- data/server/web.coffee +1 -2
- metadata +9 -10
- data/server/web.js +0 -151
data/README.md
CHANGED
@@ -19,7 +19,7 @@ A build server in the cloud.
|
|
19
19
|
-c, [--command=COMMAND] # the command to run for compilation
|
20
20
|
-n, [--name=NAME] # the name of the library (defaults to the directory name)
|
21
21
|
-o, [--output=OUTPUT] # output build artifacts to this file
|
22
|
-
-p, [--prefix=PREFIX] #
|
22
|
+
-p, [--prefix=PREFIX] # vulcan will look in this path for the compiled artifacts
|
23
23
|
-s, [--source=SOURCE] # the source directory to build from
|
24
24
|
-d, [--deps=one two three] # urls of vulcan compiled libraries to build with
|
25
25
|
-v, [--verbose] # show the full build output
|
data/lib/vulcan/cli.rb
CHANGED
@@ -23,7 +23,7 @@ if no COMMAND is specified, a sensible default will be chosen for you
|
|
23
23
|
method_option :command, :aliases => "-c", :desc => "the command to run for compilation"
|
24
24
|
method_option :name, :aliases => "-n", :desc => "the name of the library (defaults to the directory name)"
|
25
25
|
method_option :output, :aliases => "-o", :desc => "output build artifacts to this file"
|
26
|
-
method_option :prefix, :aliases => "-p", :desc => "
|
26
|
+
method_option :prefix, :aliases => "-p", :desc => "vulcan will look in this path for the compiled artifacts"
|
27
27
|
method_option :source, :aliases => "-s", :desc => "the source directory to build from"
|
28
28
|
method_option :deps, :aliases => "-d", :desc => "urls of vulcan compiled libraries to build with", :type=>:array
|
29
29
|
method_option :verbose, :aliases => "-v", :desc => "show the full build output", :type => :boolean
|
data/lib/vulcan/version.rb
CHANGED
data/server/web.coffee
CHANGED
@@ -45,11 +45,10 @@ app.post "/make", (req, res, next) ->
|
|
45
45
|
res.write "Building with: #{command}\n"
|
46
46
|
log.info "spawning build"
|
47
47
|
|
48
|
-
|
48
|
+
make = spawner.spawn "bin/make \"#{id}\"", env:
|
49
49
|
CLOUDANT_URL: process.env.CLOUDANT_URL
|
50
50
|
PATH: process.env.PATH
|
51
51
|
|
52
|
-
make = spawner.spawn "bin/make \"#{id}\"", env:env
|
53
52
|
make.on "error", (err) -> log.error(err)
|
54
53
|
make.on "data", (data) -> res.write data
|
55
54
|
make.on "exit", (code) -> res.end())
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vulcan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-05-31 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: heroku
|
16
|
-
requirement: &
|
16
|
+
requirement: &70233685257360 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: '3.0'
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70233685257360
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: multipart-post
|
30
|
-
requirement: &
|
30
|
+
requirement: &70233685255820 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ~>
|
@@ -35,10 +35,10 @@ dependencies:
|
|
35
35
|
version: 1.1.3
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *70233685255820
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: rest-client
|
41
|
-
requirement: &
|
41
|
+
requirement: &70233685248500 !ruby/object:Gem::Requirement
|
42
42
|
none: false
|
43
43
|
requirements:
|
44
44
|
- - ~>
|
@@ -46,10 +46,10 @@ dependencies:
|
|
46
46
|
version: 1.6.7
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
|
-
version_requirements: *
|
49
|
+
version_requirements: *70233685248500
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: thor
|
52
|
-
requirement: &
|
52
|
+
requirement: &70233685247460 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
55
55
|
- - ~>
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
version: 0.14.6
|
58
58
|
type: :runtime
|
59
59
|
prerelease: false
|
60
|
-
version_requirements: *
|
60
|
+
version_requirements: *70233685247460
|
61
61
|
description: Build software in the cloud
|
62
62
|
email: ddollar@gmail.com
|
63
63
|
executables:
|
@@ -808,7 +808,6 @@ files:
|
|
808
808
|
- server/vendor/gems/specifications/multi_json-1.0.3.gemspec
|
809
809
|
- server/vendor/gems/specifications/rest-client-1.6.7.gemspec
|
810
810
|
- server/web.coffee
|
811
|
-
- server/web.js
|
812
811
|
homepage: http://vulcan.com/
|
813
812
|
licenses: []
|
814
813
|
post_install_message: Please run 'vulcan update' to update your build server.
|
data/server/web.js
DELETED
@@ -1,151 +0,0 @@
|
|
1
|
-
var cradle = require('cradle');
|
2
|
-
var express = require('express');
|
3
|
-
var fs = require('fs');
|
4
|
-
var spawner = require('spawner').create();
|
5
|
-
var util = require('util');
|
6
|
-
var uuid = require('node-uuid');
|
7
|
-
|
8
|
-
var app = express.createServer(
|
9
|
-
express.logger(),
|
10
|
-
express.cookieParser(),
|
11
|
-
express.session({ secret: process.env.SECRET }),
|
12
|
-
require('connect-form')({ keepExtensions: true })
|
13
|
-
);
|
14
|
-
|
15
|
-
function log_action(uuid, message) {
|
16
|
-
console.log(uuid + ': ' + message);
|
17
|
-
}
|
18
|
-
|
19
|
-
function log_error(uuid, message) {
|
20
|
-
log_action(uuid, 'ERROR: ' + message);
|
21
|
-
}
|
22
|
-
|
23
|
-
// connect to couchdb
|
24
|
-
var couchdb_url = require('url').parse(process.env.CLOUDANT_URL);
|
25
|
-
var couchdb_options = couchdb_url.auth ?
|
26
|
-
{ auth: { username: couchdb_url.auth.split(':')[0], password: couchdb_url.auth.split(':')[1] } } :
|
27
|
-
{ }
|
28
|
-
var db = new(cradle.Connection)(couchdb_url.hostname, couchdb_url.port || 5984, couchdb_options).database('make');
|
29
|
-
db.create(function(){});
|
30
|
-
|
31
|
-
// POST /make starts a build
|
32
|
-
app.post('/make', function(request, response, next) {
|
33
|
-
|
34
|
-
// require a form
|
35
|
-
if (! request.form) {
|
36
|
-
console.log('invalid form');
|
37
|
-
response.write('invalid form');
|
38
|
-
response.send(500);
|
39
|
-
} else {
|
40
|
-
|
41
|
-
// form handler
|
42
|
-
request.form.complete(function(err, fields, files) {
|
43
|
-
|
44
|
-
// if there's an error, pass through to the next handler
|
45
|
-
if (err) { return next(err); }
|
46
|
-
|
47
|
-
// match on the shared secret
|
48
|
-
if (fields.secret != process.env.SECRET) {
|
49
|
-
response.write('invalid secret');
|
50
|
-
response.send(500);
|
51
|
-
} else {
|
52
|
-
|
53
|
-
var id = uuid();
|
54
|
-
var command = fields.command;
|
55
|
-
var prefix = fields.prefix;
|
56
|
-
var deps = [];
|
57
|
-
|
58
|
-
if (fields.deps) {
|
59
|
-
deps = JSON.parse(fields.deps);
|
60
|
-
}
|
61
|
-
|
62
|
-
// return the build id as a header
|
63
|
-
response.header('X-Make-Id', id);
|
64
|
-
|
65
|
-
// send data as a keepalive
|
66
|
-
setInterval(function() {
|
67
|
-
response.write(String.fromCharCode(0) + String.fromCharCode(10));
|
68
|
-
}, 1000);
|
69
|
-
|
70
|
-
// create a couchdb documents for this build
|
71
|
-
log_action(id, 'saving to couchdb');
|
72
|
-
db.save(id, { command:command, prefix:prefix, deps:deps }, function(err, doc) {
|
73
|
-
if (err) { log_error(id, util.inspect(err)); return next(err); }
|
74
|
-
|
75
|
-
// save the input tarball as an attachment
|
76
|
-
log_action(id, 'saving attachment - [id:' + doc.id + ', rev:' + doc.rev + ']')
|
77
|
-
fs.createReadStream(files.code.path).pipe(db.saveAttachment(
|
78
|
-
{id: doc.id,
|
79
|
-
rev: doc.rev},
|
80
|
-
{name:'input',
|
81
|
-
'Content-Type': 'application/octet-stream'},
|
82
|
-
function(err, data) {
|
83
|
-
|
84
|
-
// finish uploading message
|
85
|
-
response.write('done\n');
|
86
|
-
|
87
|
-
response.write('Building with: ' + command + '\n');
|
88
|
-
|
89
|
-
if (err) {
|
90
|
-
// work around temporary problem with cloudant and document
|
91
|
-
// conflicts
|
92
|
-
if (err.error != 'conflict') {
|
93
|
-
log_error(id, err.reason);
|
94
|
-
return next(err.reason);
|
95
|
-
}
|
96
|
-
}
|
97
|
-
|
98
|
-
// spawn bin/make with this build id
|
99
|
-
log_action(id, 'spawning build');
|
100
|
-
var ls = spawner.spawn('bin/make ' + id, function(err) {
|
101
|
-
log_error(id, 'could not spawn: ' + err);
|
102
|
-
response.write('could not spawn: ' + err);
|
103
|
-
response.send(500);
|
104
|
-
});
|
105
|
-
|
106
|
-
ls.on('error', function(error) {
|
107
|
-
log_error(id, 'spawn error: ' + util.inspect(error));
|
108
|
-
response.write('error: ' + util.inspect(error));
|
109
|
-
response.send(500);
|
110
|
-
});
|
111
|
-
|
112
|
-
ls.on('data', function(data) {
|
113
|
-
response.write(data);
|
114
|
-
});
|
115
|
-
|
116
|
-
ls.on('exit', function(code) {
|
117
|
-
response.end();
|
118
|
-
});
|
119
|
-
}
|
120
|
-
));
|
121
|
-
});
|
122
|
-
}
|
123
|
-
|
124
|
-
});
|
125
|
-
}
|
126
|
-
});
|
127
|
-
|
128
|
-
// download build output
|
129
|
-
app.get('/output/:id', function(request, response, next) {
|
130
|
-
|
131
|
-
// from couchdb
|
132
|
-
var stream = db.getAttachment(request.params.id, 'output', function(){});
|
133
|
-
|
134
|
-
stream.on('error', function(err) {
|
135
|
-
console.log('download error: ' + err);
|
136
|
-
});
|
137
|
-
|
138
|
-
stream.on('data', function(chunk) {
|
139
|
-
response.write(chunk, 'binary');
|
140
|
-
});
|
141
|
-
|
142
|
-
stream.on('end', function(chunk) {
|
143
|
-
response.end();
|
144
|
-
});
|
145
|
-
|
146
|
-
});
|
147
|
-
|
148
|
-
// start up the webserver
|
149
|
-
var port = process.env.PORT || 3000;
|
150
|
-
console.log('listening on port ' + port);
|
151
|
-
app.listen(port);
|