Class: ItamaeMitsurin::CLI
- Inherits:
-
Thor
- Object
- Thor
- ItamaeMitsurin::CLI
- Defined in:
- lib/itamae-mitsurin/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
- #docker(*recipe_files) ⇒ Object
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #local(*recipe_files) ⇒ Object
- #ssh(*recipe_files) ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
11 12 13 14 15 16 |
# File 'lib/itamae-mitsurin/cli.rb', line 11 def initialize(*) super ItamaeMitsurin.logger.level = ::Logger.const_get([:log_level].upcase) ItamaeMitsurin.logger.formatter.colored = [:color] end |
Class Method Details
.define_exec_options ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/itamae-mitsurin/cli.rb', line 18 def self. option :recipe_graph, type: :string, desc: "[EXPERIMENTAL] Write recipe dependency graph in DOT", banner: "PATH" option :node_json, type: :string, aliases: ['-j'] option :node_yaml, type: :string, aliases: ['-y'] option :dry_run, type: :boolean, aliases: ['-n'] option :shell, type: :string, default: "/bin/sh" option :ohai, type: :boolean, default: false, desc: "This option is DEPRECATED and will be unavailable." option :profile, type: :string, desc: "[EXPERIMENTAL] Save profiling data", banner: "PATH" option :detailed_exitcode, type: :boolean, default: false, desc: "exit code 0 - The run succeeded with no changes or failures, exit code 1 - The run failed, exit code 2 - The run succeeded, and some resources were changed" end |
Instance Method Details
#docker(*recipe_files) ⇒ Object
67 68 69 70 71 72 73 |
# File 'lib/itamae-mitsurin/cli.rb', line 67 def docker(*recipe_files) if recipe_files.empty? raise "Please specify recipe files." end run(recipe_files, :docker, ) end |
#local(*recipe_files) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/itamae-mitsurin/cli.rb', line 33 def local(*recipe_files) if recipe_files.empty? raise "Please specify recipe files." end run(recipe_files, :local, ) end |
#ssh(*recipe_files) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/itamae-mitsurin/cli.rb', line 50 def ssh(*recipe_files) if recipe_files.empty? raise "Please specify recipe files." end unless [:host] || [:vagrant] raise "Please set '-h <hostname>' or '--vagrant'" end run(recipe_files, :ssh, ) end |
#version ⇒ Object
76 77 78 |
# File 'lib/itamae-mitsurin/cli.rb', line 76 def version puts "itamae-mitsurin v#{ItamaeMitsurin::VERSION}" end |