Sha256: 69f9671fdfd47bf735977daab5e33035159fa9f15c3c5b25b6459270bd54eb04

Contents?: true

Size: 1.4 KB

Versions: 1

Compression:

Stored size: 1.4 KB

Contents

require 'thor'
require 'blazing/runner'

module Blazing
  class CLI < Thor

    default_task :help

    desc 'init', 'Generate a blazing config file'

    #
    # Bootstrap blazing by creating a sample config file
    #
    def init
      Blazing::Runner.init
    end

    desc 'setup [TARGET]', 'Setup local and remote repository/repositories for deployment'

    method_option :file,
      :type    => :string,
      :aliases => '-f',
      :banner  => 'Specify a configuration file'

    #
    # Setup a target to be deployed with blazing
    #
    def setup(target_name = nil)
      Blazing::Runner.new(target_name, options).setup
    end

    desc 'update [TARGET]', 'Re-Generate and uplaod hook based on current configuration'

    method_option :file,
      :type    => :string,
      :aliases => '-f',
      :banner  => 'Specify a configuration file'

    #
    # Update the target hook so it matches the settings in the config
    #
    def update(target_name = nil)
      Blazing::Runner.new(target_name, options).update
    end

    desc 'recipes [TARGET]', 'Run the recipes for the given target'

    #
    # Run the configured blazing recipes (used on remote machien)
    #
    def recipes(target_name)
      Blazing::Runner.new(target_name, options).recipes
    end

    desc 'list', 'List available recipes'

    #
    # List the available blazing recipes
    #
    def list
      Blazing::Runner.list
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blazing-0.2.10 lib/blazing/cli.rb