Module: Proteus::Commands::Graph

Defined in:
lib/proteus/commands/graph.rb

Class Method Summary collapse

Class Method Details

.included(thor_class) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/proteus/commands/graph.rb', line 4

def self.included(thor_class)
  thor_class.class_eval do

    desc "graph", "Creates a graph showing the resources and their relations."
    def graph
      say "Generating graph. This might take a while"
      graph_command = "        cd \#{context_path(context)} \\\n        && terraform graph -draw-cycles -module-depth=1 | dot -Tpng > graph.png \\\n        && open graph.png\n      GRAPH_COMMAND\n      `\#{graph_command}`\n    end\n\n  end\nend\n"