vulcan 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1 +1,80 @@
1
- This repo has been moved to [heroku/vulcan](http://github.com/heroku/vulcan)
1
+ # Vulcan
2
+
3
+ A build server in the cloud.
4
+
5
+ ## Usage
6
+
7
+ $ vulcan help
8
+ Tasks:
9
+ vulcan build # build a piece of software for the heroku cloud using COMMAND as a build command if no COMMAND is...
10
+ vulcan create APP_NAME # create a build server on Heroku
11
+ vulcan help [TASK] # Describe available tasks or one specific task
12
+ vulcan update # update the build server
13
+
14
+ $ vulcan help build
15
+ Usage:
16
+ vulcan build
17
+
18
+ Options:
19
+ -c, [--command=COMMAND] # the command to run for compilation
20
+ -n, [--name=NAME] # the name of the library (defaults ot the directory name)
21
+ -o, [--output=OUTPUT] # output build artifacts to this file
22
+ -p, [--prefix=PREFIX] # the build/install --prefix of the software
23
+ -s, [--source=SOURCE] # the source directory to build from
24
+ -v, [--verbose] # show the full build output
25
+
26
+ build a piece of software for the heroku cloud using COMMAND as a build command
27
+ if no COMMAND is specified, a sensible default will be chosen for you
28
+
29
+ ## Examples
30
+
31
+ ### Create a Build Server
32
+
33
+ $ vulcan create vulcan-david
34
+ Creating vulcan-david... done, stack is cedar
35
+ http://vulcan-david.herokuapp.com/ | git@heroku.com:vulcan-david.git
36
+ ...
37
+
38
+ ### Build
39
+
40
+ $ vulcan build -s ~/Code/memcached -p /tmp/memcached -c "./autogen.sh && ./configure --prefix=/tmp/memcached && make install"
41
+ >> Packaging local directory
42
+ >> Uploading code for build
43
+ >> Building with: ./autogen.sh && ./configure --prefix=/tmp/memcached && make install
44
+ >> Downloading build artifacts to: /tmp/memcached.tgz
45
+
46
+ $ tar tvf /tmp/memcached.tgz
47
+ drwx------ 0 u24714 24714 0 Sep 21 20:25 bin/
48
+ -rwxr-xr-x 0 u24714 24714 273082 Sep 21 20:25 bin/memcached
49
+ drwx------ 0 u24714 24714 0 Sep 21 20:25 include/
50
+ drwx------ 0 u24714 24714 0 Sep 21 20:25 include/memcached/
51
+ -rw-r--r-- 0 u24714 24714 14855 Sep 21 20:25 include/memcached/protocol_binary.h
52
+ drwx------ 0 u24714 24714 0 Sep 21 20:25 share/
53
+ drwx------ 0 u24714 24714 0 Sep 21 20:25 share/man/
54
+ drwx------ 0 u24714 24714 0 Sep 21 20:25 share/man/man1/
55
+ -rw-r--r-- 0 u24714 24714 5304 Sep 21 20:25 share/man/man1/memcached.1
56
+
57
+ ### Keep the Build Server Updated
58
+
59
+ $ vulcan update
60
+ Initialized empty Git repository in /private/var/folders/rm/qksq9jk15vx0xcjxkqc8yg5w0000gn/T/d20110921-70016-1iksqwy/.git/
61
+ Counting objects: 176, done.
62
+ Delta compression using up to 8 threads.
63
+ Compressing objects: 100% (156/156), done.
64
+ Writing objects: 100% (176/176), 326.86 KiB, done.
65
+ Total 176 (delta 5), reused 0 (delta 0)
66
+
67
+ -----> Heroku receiving push
68
+ -----> Node.js app detected
69
+ -----> Vendoring node 0.4.7
70
+ -----> Installing dependencies with npm 1.0.27
71
+
72
+ Dependencies installed
73
+ -----> Discovering process types
74
+ Procfile declares types -> web
75
+ -----> Compiled slug size is 5.5MB
76
+ -----> Launching... done, v5
77
+ http://vulcan-david.herokuapp.com deployed to Heroku
78
+
79
+ To git@heroku.com:vulcan-david.git
80
+ + 2e69a42...eddcb91 master -> master (forced update)
data/lib/vulcan/cli.rb CHANGED
@@ -25,6 +25,7 @@ if no COMMAND is specified, a sensible default will be chosen for you
25
25
  method_option :output, :aliases => "-o", :desc => "output build artifacts to this file"
26
26
  method_option :prefix, :aliases => "-p", :desc => "the build/install --prefix of the software"
27
27
  method_option :source, :aliases => "-s", :desc => "the source directory to build from"
28
+ method_option :deps, :aliases => "-d", :desc => "other vulcan compiled libraries to build with"
28
29
  method_option :verbose, :aliases => "-v", :desc => "show the full build output", :type => :boolean
29
30
 
30
31
  def build
@@ -35,6 +36,7 @@ if no COMMAND is specified, a sensible default will be chosen for you
35
36
  output = options[:output] || "/tmp/#{name}.tgz"
36
37
  prefix = options[:prefix] || "/app/vendor/#{name}"
37
38
  command = options[:command] || "./configure --prefix #{prefix} && make install"
39
+ deps = options[:deps] || ""
38
40
  server = URI.parse(ENV["MAKE_SERVER"] || "http://#{app}.herokuapp.com")
39
41
 
40
42
  Dir.mktmpdir do |dir|
@@ -47,7 +49,8 @@ if no COMMAND is specified, a sensible default will be chosen for you
47
49
  "code" => UploadIO.new(input, "application/octet-stream", "input.tgz"),
48
50
  "command" => command,
49
51
  "prefix" => prefix,
50
- "secret" => config[:secret]
52
+ "secret" => config[:secret],
53
+ "deps" => deps
51
54
 
52
55
  puts ">> Building with: #{command}"
53
56
  response = Net::HTTP.start(server.host, server.port) do |http|
@@ -1,5 +1,5 @@
1
1
  module Vulcan
2
2
 
3
- VERSION = "0.4.0"
3
+ VERSION = "0.5.0"
4
4
 
5
5
  end
data/server/bin/make CHANGED
@@ -10,7 +10,8 @@ id = ARGV.shift
10
10
  require "couchrest"
11
11
  require "fileutils"
12
12
  require "tmpdir"
13
-
13
+ require "rest_client"
14
+
14
15
  db = CouchRest.database!(ENV["CLOUDANT_URL"] + "/make")
15
16
 
16
17
  Dir.mktmpdir do |dir|
@@ -19,11 +20,42 @@ Dir.mktmpdir do |dir|
19
20
 
20
21
  command = doc["command"]
21
22
  prefix = doc["prefix"]
23
+ deps = doc["deps"] || ""
22
24
 
23
25
  File.open("input.tgz", "wb") do |file|
24
26
  file.print doc.fetch_attachment("input")
25
27
  end
26
28
 
29
+ deps.split(",").each_with_index do |dep, index|
30
+ puts "downloading #{dep}"
31
+ File.open("dep_#{index}.tgz", "wb") do |file|
32
+ begin
33
+ file.print RestClient.get(dep)
34
+ rescue Exception => ex
35
+ puts ex.inspect
36
+ end
37
+ end
38
+ end
39
+
40
+ FileUtils.mkdir_p "deps"
41
+
42
+ Dir.chdir("deps") do
43
+ deps.split(",").each_with_index do |dep, index|
44
+ %x{ tar xzf ../dep_#{index}.tgz 2>&1 }
45
+ end
46
+ end
47
+
48
+ unless deps.empty?
49
+ ENV["LDFLAGS"] ||= ""
50
+ ENV["LDFLAGS"] += " -L%s/deps/lib" % dir
51
+
52
+ ENV["CFLAGS"] ||= ""
53
+ ENV["CFLAGS"] += " -I%s/deps/include" % dir
54
+
55
+ ENV["CXXFLAGS"] ||= ""
56
+ ENV["CXXFLAGS"] += " -I%s/deps/include" % dir
57
+ end
58
+
27
59
  FileUtils.mkdir_p "input"
28
60
 
29
61
  Dir.chdir("input") do
data/server/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "heroku-make",
3
3
  "version": "0.0.1",
4
- "dependencies": [
5
- "connect-form",
6
- "cradle",
7
- "express",
8
- "knox",
9
- "node-uuid",
10
- "restler"
11
- ],
4
+ "dependencies": {
5
+ "connect-form": "0.2.x",
6
+ "cradle": "0.6.x",
7
+ "express": "2.x.x",
8
+ "knox": "0.0.x",
9
+ "node-uuid": "1.x.x",
10
+ "restler": "2.x.x"
11
+ },
12
12
  "engines": {
13
13
  "node": "0.6.x"
14
14
  }
data/server/web.js CHANGED
@@ -26,7 +26,7 @@ var couchdb_options = couchdb_url.auth ?
26
26
  { auth: { username: couchdb_url.auth.split(':')[0], password: couchdb_url.auth.split(':')[1] } } :
27
27
  { }
28
28
  var db = new(cradle.Connection)(couchdb_url.hostname, couchdb_url.port || 5984, couchdb_options).database('make');
29
- db.create();
29
+ db.create(function(){});
30
30
 
31
31
  // POST /make starts a build
32
32
  app.post('/make', function(request, response, next) {
@@ -53,20 +53,20 @@ app.post('/make', function(request, response, next) {
53
53
  var id = uuid();
54
54
  var command = fields.command;
55
55
  var prefix = fields.prefix;
56
+ var deps = fields.deps;
56
57
 
57
58
  // create a couchdb documents for this build
58
59
  log_action(id, 'saving to couchdb');
59
- db.save(id, { command:command, prefix:prefix }, function(err, doc) {
60
+ db.save(id, { command:command, prefix:prefix, deps:deps }, function(err, doc) {
60
61
  if (err) { log_error(id, util.inspect(err)); return next(err); }
61
62
 
62
63
  // save the input tarball as an attachment
63
64
  log_action(id, 'saving attachment - [id:' + doc.id + ', rev:' + doc.rev + ']')
64
- db.saveAttachment(
65
- doc.id,
66
- doc.rev,
67
- 'input',
68
- 'application/octet-stream',
69
- fs.createReadStream(files.code.path),
65
+ fs.createReadStream(files.code.path).pipe(db.saveAttachment(
66
+ {id: doc.id,
67
+ rev: doc.rev},
68
+ {name:'input',
69
+ 'Content-Type': 'application/octet-stream'},
70
70
  function(err, data) {
71
71
  if (err) {
72
72
  // work around temporary problem with cloudant and document
@@ -99,7 +99,7 @@ app.post('/make', function(request, response, next) {
99
99
  response.end();
100
100
  });
101
101
  }
102
- );
102
+ ));
103
103
 
104
104
  // return the build id as a header
105
105
  response.header('X-Make-Id', id);
@@ -114,7 +114,7 @@ app.post('/make', function(request, response, next) {
114
114
  app.get('/output/:id', function(request, response, next) {
115
115
 
116
116
  // from couchdb
117
- var stream = db.getAttachment(request.params.id, 'output');
117
+ var stream = db.getAttachment(request.params.id, 'output', function(){});
118
118
 
119
119
  stream.on('error', function(err) {
120
120
  console.log('download error: ' + err);
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.4.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-05 00:00:00.000000000 Z
12
+ date: 2012-03-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: heroku
16
- requirement: &70102058845160 !ruby/object:Gem::Requirement
16
+ requirement: &70318115078740 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.20.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70102058845160
24
+ version_requirements: *70318115078740
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: multipart-post
27
- requirement: &70102058844240 !ruby/object:Gem::Requirement
27
+ requirement: &70318115075980 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.1.3
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70102058844240
35
+ version_requirements: *70318115075980
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rest-client
38
- requirement: &70102058843520 !ruby/object:Gem::Requirement
38
+ requirement: &70318115073940 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.6.7
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70102058843520
46
+ version_requirements: *70318115073940
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: thor
49
- requirement: &70102058842760 !ruby/object:Gem::Requirement
49
+ requirement: &70318115072520 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 0.14.6
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70102058842760
57
+ version_requirements: *70318115072520
58
58
  description: Build software in the cloud
59
59
  email: ddollar@gmail.com
60
60
  executables: