Class: Kubes::CLI::Compile

Inherits:
Base
  • Object
show all
Defined in:
lib/kubes/cli/compile.rb

Constant Summary collapse

@@compiled =

Separate command like prune can call compile. Apply also calls Prune. Instead of moving Compile out of Prune, will use this class variable. In case we have other cases where compile is called in another area. We only want compiled to be called once so hooks only fire once. Done here so we don’t clean and remove the .kubes/output folder.

false

Instance Method Summary collapse

Methods inherited from Base

#compile, #initialize, #pod_name

Methods included from Logging

#logger

Constructor Details

This class inherits a constructor from Kubes::CLI::Base

Instance Method Details

#build_docker_imageObject

auto build docker image and push image if kubes docker build not yet called



18
19
20
21
# File 'lib/kubes/cli/compile.rb', line 18

def build_docker_image
  return if File.exist?(Kubes.config.state.path)
  Build.new(@options).run
end

#runObject



9
10
11
12
13
14
15
# File 'lib/kubes/cli/compile.rb', line 9

def run
  return if @@compiled
  build_docker_image
  Clean.new(@options.merge(mute: true)).run
  Kubes::Compiler.new(@options).run
  @@compiled = true
end