Sha256: 59c563ca5d67a4c487e58b500e118e988041276792440d7a29cc8dd133f74453

Contents?: true

Size: 1.52 KB

Versions: 10

Compression:

Stored size: 1.52 KB

Contents

module Depengine
  module CLI
    class << self

      def run(args, input = $stdin, output = $stdout, error = $stderr) #:nodoc:

        @deploy_home = '.'
        @recipe_name = 'recipe/deploy.rb'

        args_size=args.size

        args.options do |o|
          o.banner = "Usage: #{File.basename($0)} [options]"
          o.separator ""
          o.on('-h', '--deployhome [DIRNAME]', 'Home of deployments.') do |dname|
            set :deploy_home, dname
          end
          o.on('-b', '--recipe-base-dir [DIRNAME]', 'Home of recipes. This takes precedence over --deployhome for recipe location.') do |dname|
            set :recipe_base_dir, dname
          end
          o.on('-r', '--recipe [FILENAME]', 'Filename of the recipe.') do |fname|
            @recipe_name = fname
          end
          o.on('-e', '--env [ENVNAME]', 'Environment name.') do |ename|
            set :env, ename
          end
          o.on('-t', '--maven_test_switch [SWITCH]', 'Disable mvn tests.') do |tname|
          set :maven_test_switch, tname
          end
          o.on('-v', '--version [VERSION]', 'Version.') do |vname|
            set :version, vname
          end
          o.parse!
        end
        unless args_size > 2
           error << args.options
           return 127
         end

        recipe_filename   = File.join(($recipe_config[:recipe_base_dir] || $recipe_config[:deploy_home]), @recipe_name)
        puts "Evaluating recipe #{recipe_filename}"
        eval(File.new(recipe_filename).read)
        return 0
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
depengine-3.0.12 lib/depengine/cli.rb
depengine-3.0.11 lib/depengine/cli.rb
depengine-3.0.10 lib/depengine/cli.rb
depengine-3.0.9 lib/depengine/cli.rb
depengine-3.0.8 lib/depengine/cli.rb
depengine-3.0.7 lib/depengine/cli.rb
depengine-3.0.6 lib/depengine/cli.rb
depengine-3.0.5 lib/depengine/cli.rb
depengine-3.0.4 lib/depengine/cli.rb
depengine-3.0.3 lib/depengine/cli.rb