vulcan 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # Vulcan
2
+
3
+ A build server in the cloud.
4
+
5
+ ## Usage
6
+
7
+ $ vulcan help
8
+ Tasks:
9
+ vulcan build [COMMAND] # 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 [COMMAND]
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
+ "*V
57
+
58
+ ### Keep the Build Server Updated
59
+
60
+ $ vulcan update
61
+ Initialized empty Git repository in /private/var/folders/rm/qksq9jk15vx0xcjxkqc8yg5w0000gn/T/d20110921-70016-1iksqwy/.git/
62
+ Counting objects: 176, done.
63
+ Delta compression using up to 8 threads.
64
+ Compressing objects: 100% (156/156), done.
65
+ Writing objects: 100% (176/176), 326.86 KiB, done.
66
+ Total 176 (delta 5), reused 0 (delta 0)
67
+
68
+ -----> Heroku receiving push
69
+ -----> Node.js app detected
70
+ -----> Vendoring node 0.4.7
71
+ -----> Installing dependencies with npm 1.0.27
72
+
73
+ Dependencies installed
74
+ -----> Discovering process types
75
+ Procfile declares types -> web
76
+ -----> Compiled slug size is 5.5MB
77
+ -----> Launching... done, v5
78
+ http://vulcan-david.herokuapp.com deployed to Heroku
79
+
80
+ To git@heroku.com:vulcan-david.git
81
+ + 2e69a42...eddcb91 master -> master (forced update)
data/lib/vulcan/cli.rb CHANGED
@@ -9,7 +9,7 @@ require "yaml"
9
9
 
10
10
  class Vulcan::CLI < Thor
11
11
 
12
- desc "build [COMMAND]", <<-DESC
12
+ desc "build", <<-DESC
13
13
  build a piece of software for the heroku cloud using COMMANd as a build command
14
14
  if no COMMAND is specified, a sensible default will be chosen for you
15
15
 
@@ -25,10 +25,10 @@ if no COMMAND is specified, a sensible default will be chosen for you
25
25
  def build
26
26
  app = read_config[:app] || "need a server first, use vulcan create"
27
27
 
28
- name = options[:name] || File.basename(Dir.pwd)
28
+ source = options[:source] || Dir.pwd
29
+ name = options[:name] || File.basename(source)
29
30
  output = options[:output] || "/tmp/#{name}.tgz"
30
31
  prefix = options[:prefix] || "/app/vendor/#{name}"
31
- source = options[:source] || Dir.pwd
32
32
  command = options[:command] || "./configure --prefix #{prefix} && make install"
33
33
  server = URI.parse(ENV["MAKE_SERVER"] || "http://#{app}.herokuapp.com")
34
34
 
@@ -41,7 +41,8 @@ if no COMMAND is specified, a sensible default will be chosen for you
41
41
  request = Net::HTTP::Post::Multipart.new "/make",
42
42
  "code" => UploadIO.new(input, "application/octet-stream", "input.tgz"),
43
43
  "command" => command,
44
- "prefix" => prefix
44
+ "prefix" => prefix,
45
+ "secret" => config[:secret]
45
46
 
46
47
  puts ">> Building with: #{command}"
47
48
  response = Net::HTTP.start(server.host, server.port) do |http|
@@ -1,5 +1,5 @@
1
1
  module Vulcan
2
2
 
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
 
5
5
  end
data/server/web.js CHANGED
@@ -24,10 +24,7 @@ var couchdb_options = couchdb_url.auth ?
24
24
 
25
25
  var db = new(cradle.Connection)(couchdb_url.hostname, couchdb_url.port || 5984, couchdb_options).database('make');
26
26
 
27
- db.create(function(err, data) {
28
- console.log('cerr: %s', err);
29
- console.log('cdat: %s', data);
30
- });
27
+ db.create();
31
28
 
32
29
  app.post('/make', function(request, response, next) {
33
30
  if (! request.form) {
@@ -37,43 +34,44 @@ app.post('/make', function(request, response, next) {
37
34
  if (err) {
38
35
  next(err);
39
36
  } else {
40
- var id = uuid();
41
- var command = fields.command;
42
- var prefix = fields.prefix;
43
-
44
- var doc = db.save(id, { command:command, prefix:prefix }, function(err, doc) {
45
- console.log('err: %s', sys.inspect(err));
46
- console.log('doc: %s', sys.inspect(doc));
47
-
48
- db.saveAttachment(
49
- doc.id,
50
- doc.rev,
51
- 'input',
52
- 'application/octet-stream',
53
- fs.createReadStream(files.code.path),
54
- function(err, data) {
55
- var ls = spawner.spawn('bin/make ' + id, function(err) {
56
- console.log('couldnt spawn: ' + err);
57
- });
58
-
59
- ls.on('error', function(error) {
60
- response.writeHead(500);
61
- console.log('error: ' + error);
62
- response.end();
63
- });
64
-
65
- ls.on('data', function(data) {
66
- response.write(data);
67
- });
68
-
69
- ls.on('exit', function(code) {
70
- response.end();
71
- });
72
- }
73
- );
74
-
75
- response.header('X-Make-Id', id);
76
- });
37
+ if (fields.secret != process.env.SECRET) {
38
+ response.send(500);
39
+ } else {
40
+ var id = uuid();
41
+ var command = fields.command;
42
+ var prefix = fields.prefix;
43
+
44
+ var doc = db.save(id, { command:command, prefix:prefix }, function(err, doc) {
45
+ db.saveAttachment(
46
+ doc.id,
47
+ doc.rev,
48
+ 'input',
49
+ 'application/octet-stream',
50
+ fs.createReadStream(files.code.path),
51
+ function(err, data) {
52
+ var ls = spawner.spawn('bin/make ' + id, function(err) {
53
+ console.log('couldnt spawn: ' + err);
54
+ });
55
+
56
+ ls.on('error', function(error) {
57
+ response.writeHead(500);
58
+ console.log('error: ' + error);
59
+ response.end();
60
+ });
61
+
62
+ ls.on('data', function(data) {
63
+ response.write(data);
64
+ });
65
+
66
+ ls.on('exit', function(code) {
67
+ response.end();
68
+ });
69
+ }
70
+ );
71
+
72
+ response.header('X-Make-Id', id);
73
+ });
74
+ }
77
75
  }
78
76
  });
79
77
  }
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.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-09-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multipart-post
16
- requirement: &70149200059360 !ruby/object:Gem::Requirement
16
+ requirement: &70151753909860 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.1.3
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70149200059360
24
+ version_requirements: *70151753909860
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rest-client
27
- requirement: &70149200058680 !ruby/object:Gem::Requirement
27
+ requirement: &70151753909160 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.6.7
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70149200058680
35
+ version_requirements: *70151753909160
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: thor
38
- requirement: &70149200057980 !ruby/object:Gem::Requirement
38
+ requirement: &70151753908500 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 0.14.6
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70149200057980
46
+ version_requirements: *70151753908500
47
47
  description: Build software in the cloud
48
48
  email: ddollar@gmail.com
49
49
  executables:
@@ -55,6 +55,7 @@ files:
55
55
  - lib/vulcan/cli.rb
56
56
  - lib/vulcan/version.rb
57
57
  - lib/vulcan.rb
58
+ - README.md
58
59
  - server/bin/make
59
60
  - server/lib/on.js
60
61
  - server/lib/spawner.js