class Slugforge::Cli

Public Instance Methods

build() click to toggle source
# File lib/slugforge/cli.rb, line 30
def build
  verify_procfile_exists!
  invoke Slugforge::Commands::Build
end
debug(cmd) click to toggle source
# File lib/slugforge/cli.rb, line 120
def debug(cmd)
  eval(cmd)
end
help(command = nil, subcommand = nil) click to toggle source
Calls superclass method
# File lib/slugforge/cli.rb, line 51
    def help(command = nil, subcommand = nil)
      return super if command

      self.class.help(shell, subcommand)

      logger.say <<-HELP
Project Naming

  The easiest way to name a project is to name it after a repository. The only reason you may have to use a different
  name is for testing of some kind. That said, once you've named your project there are a few ways for slugforge to
  determine what project you are attempting to run project-specific commands (such as build) against. There are two
  basic ways of telling slugforge which project you are working with:

    1. With the provided configuration option (through a CLI flag, environment variable or config file)
    2. By running the slugforge command from inside the project's repository. slugforge will use the name of the
       project's root folder (as defined by the location of .git), which generally matches the name of the repository
       which should be the name of the project in slugforge.

Configuring the CLI

  The configuration options above can all be configured through several candidate configuration files, environment
  variables or the flags as shown. Precedence is by proximity to the command: flags trump environment, which trumps
  configuration files. Slugforge will attempt to load configuration files in the following locations, listed in order
  of priority highest to lowest:

    .slugforge
    ~/.slugforge
    /etc/slugforge

  Configuration files are written in yaml for simplicity. Below is a list of each option and the keys expected for each
  type. File keys should be split on periods and expanded into hashes. AWS buckets accepts a comma seperated list,
  which will be tried from first to last. There is an example config at the end of this screen.

      HELP

      rows = []
      rows << %w(CLI Environment File)
      Slugforge::Configuration.options.each do |name, config|
        rows << [config[:option], config[:env], config[:key]]

        unless rows.last.first.nil?
          rows.last[0] = "--#{rows.last.first}"
        end
      end
      print_table(rows, :indent => 4)

      logger.say <<-HELP

Example configuration file

    aws:
      access_key: hashhashhashhashhash
      secret_key: hashhashhashhashhashhashhashhashhashhash

      HELP
    end
pry() click to toggle source
# File lib/slugforge/cli.rb, line 112
def pry
  binding.pry
end
version() click to toggle source
# File lib/slugforge/cli.rb, line 14
def version
  logger.say_json :slugforge => Slugforge::VERSION
  logger.say "slugforge #{Slugforge::VERSION}"
end