Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #17 from lpetre/dependency_support
Browse files Browse the repository at this point in the history
Better dependency support (using arrays)
  • Loading branch information
ddollar committed Mar 22, 2012
2 parents 3505f68 + 7cafe88 commit de91288
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
13 changes: 7 additions & 6 deletions README.md
Expand Up @@ -16,12 +16,13 @@ A build server in the cloud.
vulcan build vulcan build


Options: Options:
-c, [--command=COMMAND] # the command to run for compilation -c, [--command=COMMAND] # the command to run for compilation
-n, [--name=NAME] # the name of the library (defaults ot the directory name) -n, [--name=NAME] # the name of the library (defaults to the directory name)
-o, [--output=OUTPUT] # output build artifacts to this file -o, [--output=OUTPUT] # output build artifacts to this file
-p, [--prefix=PREFIX] # the build/install --prefix of the software -p, [--prefix=PREFIX] # the build/install --prefix of the software
-s, [--source=SOURCE] # the source directory to build from -s, [--source=SOURCE] # the source directory to build from
-v, [--verbose] # show the full build output -d, [--deps=one two three] # urls of vulcan compiled libraries to build with
-v, [--verbose] # show the full build output


build a piece of software for the heroku cloud using COMMAND as a build command build a piece of software for the heroku cloud using COMMAND as a build command
if no COMMAND is specified, a sensible default will be chosen for you if no COMMAND is specified, a sensible default will be chosen for you
Expand Down
6 changes: 3 additions & 3 deletions lib/vulcan/cli.rb
Expand Up @@ -21,11 +21,11 @@ class Vulcan::CLI < Thor
DESC DESC


method_option :command, :aliases => "-c", :desc => "the command to run for compilation" method_option :command, :aliases => "-c", :desc => "the command to run for compilation"
method_option :name, :aliases => "-n", :desc => "the name of the library (defaults ot the directory name)" method_option :name, :aliases => "-n", :desc => "the name of the library (defaults to the directory name)"
method_option :output, :aliases => "-o", :desc => "output build artifacts to this file" method_option :output, :aliases => "-o", :desc => "output build artifacts to this file"
method_option :prefix, :aliases => "-p", :desc => "the build/install --prefix of the software" method_option :prefix, :aliases => "-p", :desc => "the build/install --prefix of the software"
method_option :source, :aliases => "-s", :desc => "the source directory to build from" method_option :source, :aliases => "-s", :desc => "the source directory to build from"
method_option :deps, :aliases => "-d", :desc => "other vulcan compiled libraries to build with" method_option :deps, :aliases => "-d", :desc => "urls of vulcan compiled libraries to build with", :type=>:array
method_option :verbose, :aliases => "-v", :desc => "show the full build output", :type => :boolean method_option :verbose, :aliases => "-v", :desc => "show the full build output", :type => :boolean


def build def build
Expand All @@ -36,7 +36,7 @@ def build
output = options[:output] || "/tmp/#{name}.tgz" output = options[:output] || "/tmp/#{name}.tgz"
prefix = options[:prefix] || "/app/vendor/#{name}" prefix = options[:prefix] || "/app/vendor/#{name}"
command = options[:command] || "./configure --prefix #{prefix} && make install" command = options[:command] || "./configure --prefix #{prefix} && make install"
deps = options[:deps] || "" deps = options[:deps] || []
server = URI.parse(ENV["MAKE_SERVER"] || "http://#{app}.herokuapp.com") server = URI.parse(ENV["MAKE_SERVER"] || "http://#{app}.herokuapp.com")


Dir.mktmpdir do |dir| Dir.mktmpdir do |dir|
Expand Down
6 changes: 3 additions & 3 deletions server/bin/make
Expand Up @@ -20,13 +20,13 @@ Dir.mktmpdir do |dir|


command = doc["command"] command = doc["command"]
prefix = doc["prefix"] prefix = doc["prefix"]
deps = doc["deps"] || "" deps = doc["deps"] || []


File.open("input.tgz", "wb") do |file| File.open("input.tgz", "wb") do |file|
file.print doc.fetch_attachment("input") file.print doc.fetch_attachment("input")
end end


deps.split(",").each_with_index do |dep, index| deps.each_with_index do |dep, index|
puts "downloading #{dep}" puts "downloading #{dep}"
File.open("dep_#{index}.tgz", "wb") do |file| File.open("dep_#{index}.tgz", "wb") do |file|
begin begin
Expand All @@ -40,7 +40,7 @@ Dir.mktmpdir do |dir|
FileUtils.mkdir_p "deps" FileUtils.mkdir_p "deps"


Dir.chdir("deps") do Dir.chdir("deps") do
deps.split(",").each_with_index do |dep, index| deps.each_with_index do |dep, index|
%x{ tar xzf ../dep_#{index}.tgz 2>&1 } %x{ tar xzf ../dep_#{index}.tgz 2>&1 }
end end
end end
Expand Down
2 changes: 1 addition & 1 deletion server/web.js
Expand Up @@ -53,7 +53,7 @@ app.post('/make', function(request, response, next) {
var id = uuid(); var id = uuid();
var command = fields.command; var command = fields.command;
var prefix = fields.prefix; var prefix = fields.prefix;
var deps = fields.deps; var deps = JSON.parse(fields.deps);


// create a couchdb documents for this build // create a couchdb documents for this build
log_action(id, 'saving to couchdb'); log_action(id, 'saving to couchdb');
Expand Down

0 comments on commit de91288

Please sign in to comment.