Skip to content

Loading…

Better dependency support (using arrays) #17

Merged
merged 1 commit into from

2 participants

@lpetre

Using the builtin array support in thor and couchdb.

Updated the usage statement in README.md

@ddollar ddollar merged commit de91288 into heroku:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 22, 2012
  1. @lpetre
Showing with 14 additions and 13 deletions.
  1. +7 −6 README.md
  2. +3 −3 lib/vulcan/cli.rb
  3. +3 −3 server/bin/make
  4. +1 −1 server/web.js
View
13 README.md
@@ -16,12 +16,13 @@ A build server in the cloud.
vulcan build
Options:
- -c, [--command=COMMAND] # the command to run for compilation
- -n, [--name=NAME] # the name of the library (defaults ot the directory name)
- -o, [--output=OUTPUT] # output build artifacts to this file
- -p, [--prefix=PREFIX] # the build/install --prefix of the software
- -s, [--source=SOURCE] # the source directory to build from
- -v, [--verbose] # show the full build output
+ -c, [--command=COMMAND] # the command to run for compilation
+ -n, [--name=NAME] # the name of the library (defaults to the directory name)
+ -o, [--output=OUTPUT] # output build artifacts to this file
+ -p, [--prefix=PREFIX] # the build/install --prefix of the software
+ -s, [--source=SOURCE] # the source directory to build from
+ -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
if no COMMAND is specified, a sensible default will be chosen for you
View
6 lib/vulcan/cli.rb
@@ -21,11 +21,11 @@ class Vulcan::CLI < Thor
DESC
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 :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 :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
def build
@@ -36,7 +36,7 @@ def build
output = options[:output] || "/tmp/#{name}.tgz"
prefix = options[:prefix] || "/app/vendor/#{name}"
command = options[:command] || "./configure --prefix #{prefix} && make install"
- deps = options[:deps] || ""
+ deps = options[:deps] || []
server = URI.parse(ENV["MAKE_SERVER"] || "http://#{app}.herokuapp.com")
Dir.mktmpdir do |dir|
View
6 server/bin/make
@@ -20,13 +20,13 @@ Dir.mktmpdir do |dir|
command = doc["command"]
prefix = doc["prefix"]
- deps = doc["deps"] || ""
+ deps = doc["deps"] || []
File.open("input.tgz", "wb") do |file|
file.print doc.fetch_attachment("input")
end
- deps.split(",").each_with_index do |dep, index|
+ deps.each_with_index do |dep, index|
puts "downloading #{dep}"
File.open("dep_#{index}.tgz", "wb") do |file|
begin
@@ -40,7 +40,7 @@ Dir.mktmpdir do |dir|
FileUtils.mkdir_p "deps"
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 }
end
end
View
2 server/web.js
@@ -53,7 +53,7 @@ app.post('/make', function(request, response, next) {
var id = uuid();
var command = fields.command;
var prefix = fields.prefix;
- var deps = fields.deps;
+ var deps = JSON.parse(fields.deps);
// create a couchdb documents for this build
log_action(id, 'saving to couchdb');
Something went wrong with that request. Please try again.