Sha256: 7e7f4ed9e83ac44f7829718b482cb27436454b8225a0179e87f7a93108d0a477

Contents?: true

Size: 1.43 KB

Versions: 8

Compression:

Stored size: 1.43 KB

Contents

#!/usr/bin/env ruby 

require 'optparse'
require 'whiskey_disk/rake'

$0 = "#{$0} setup|deploy"  # jesus, this is a hack.

options = {}
op = OptionParser.new do |opts|
  opts.on('-t=TARGET', '--to=TARGET', "deployment target") do |target| 
    options[:target] = target
  end
  
  opts.on('-p=TARGET', '--path=TARGET', "configuration path") do |path|
    options[:path] = path
  end
    
  opts.on('-o=DOMAIN', '--only=DOMAIN', "limit deployment to this domain") do |domain|
    options[:only] = domain
  end
    
  opts.on('-c', '--check', "do a staleness check before deploying") do |path|
    options[:check] = 'true'
  end

  opts.on('-d', '--debug', "turn on debug mode (ssh -v and rake --trace)") do
    options[:debug] = 'true'
  end
    
  opts.on('--version', 'show current version') do
    puts File.read(File.expand_path(File.join(File.dirname(__FILE__), '..', 'VERSION')))
    exit 0
  end
  
  opts.on_tail('-h', '--help', 'show this message') do
    abort opts.to_s
  end
end

begin
  rest = op.parse(ARGV) 
rescue 
  abort op.to_s 
end

abort op.to_s unless options[:target]
abort op.to_s unless rest and rest.size == 1
command = rest.first
abort op.to_s unless ['deploy', 'setup'].include?(command)

ENV['to'] = options[:target]
ENV['path'] = options[:path]
ENV['only'] = options[:only]
ENV['check'] = options[:check]
ENV['debug'] = options[:debug]

if command == 'deploy'
  Rake::Task['deploy:now'].invoke
else
  Rake::Task['deploy:setup'].invoke
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
ol-whisk_deploy-0.6.25 bin/wd
ol-whisk_deploy-0.6.26 bin/wd
whisk_deploy-0.6.26 bin/wd
whiskey_disk-0.6.24 bin/wd
whiskey_disk-0.6.23 bin/wd
whiskey_disk-0.6.22 bin/wd
whiskey_disk-0.6.21 bin/wd
whiskey_disk-0.6.20 bin/wd