Sha256: e38435f602583b351d9ff6213ccfaa4ae66ad2efc9ae8995ccbcc91b5f5b2cbd
Contents?: true
Size: 1.1 KB
Versions: 7
Compression:
Stored size: 1.1 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_tail('-h', '--help', 'show this message') do raise opts.to_s end end rest = op.parse(ARGV) raise op.to_s unless options[:target] raise op.to_s unless rest and rest.size == 1 command = rest.first raise op.to_s unless ['deploy', 'setup'].include?(command) ENV['to'] = options[:target] ENV['path'] = options[:path] ENV['only'] = options[:only] ENV['check'] = options[:check] if command == 'deploy' Rake::Task['deploy:now'].invoke else Rake::Task['deploy:setup'].invoke end
Version data entries
7 entries across 7 versions & 1 rubygems