Sha256: c73cdfc0cc1e7cfe4429ae612184e69eab25a22e6384c4928b33699d2be69ae9
Contents?: true
Size: 1.37 KB
Versions: 23
Compression:
Stored size: 1.37 KB
Contents
#!/usr/bin/env ruby require 'thor' require_relative '../lib/convection/control/cloud' module Convection ## # Convection CLI ## class CLI < Thor class_option :cloudfile, :type => :string, :default => 'Cloudfile' def initialize(*args) super @cloud = Control::Cloud.new @cwd = Dir.getwd end desc 'converge STACK', 'Converge your cloud' def converge(stack = nil) @cloud.configure(File.absolute_path(options['cloudfile'], @cwd)) @cloud.converge(stack) do |event, errors| say_status(*event.to_thor) errors.each do |error| say "* #{ error.message }" error.backtrace.each { |b| say " #{ b }" } end unless errors.nil? end end desc 'diff', 'Show changes that will be applied by converge' def diff @cloud.configure(File.absolute_path(options['cloudfile'], @cwd)) @cloud.diff { |d| say_status(*d.to_thor) } end desc 'print STACK', 'Print the rendered template for STACK' def print(stack) @cloud.configure(File.absolute_path(options['cloudfile'], @cwd)) puts @cloud.stacks[stack].to_json(true) end desc 'validate STACK', 'Validate the rendered template for STACK' def validate(stack) @cloud.configure(File.absolute_path(options['cloudfile'], @cwd)) @cloud.stacks[stack].validate end end end Convection::CLI.start(ARGV)
Version data entries
23 entries across 23 versions & 1 rubygems