Module: Kubes::Core
Instance Method Summary collapse
- #app ⇒ Object
- #check_project! ⇒ Object
- #config ⇒ Object
- #configure(&block) ⇒ Object
-
#deep_merge!(a, b) ⇒ Object
wrapper to ensure we use the same deeper_merge options everywhere.
- #env ⇒ Object
- #extra ⇒ Object
- #kustomize? ⇒ Boolean
- #logger ⇒ Object
- #root ⇒ Object
Instance Method Details
#app ⇒ Object
5 6 7 |
# File 'lib/kubes/core.rb', line 5 def app ENV['KUBES_APP'] unless ENV['KUBES_APP'].blank? end |
#check_project! ⇒ Object
40 41 42 43 44 |
# File 'lib/kubes/core.rb', line 40 def check_project! return if File.exist?("#{Kubes.root}/.kubes/config.rb") logger.error "ERROR: It doesnt look like this is a kubes project. Are you sure you are in a kubes project?".color(:red) ENV['KUBES_TEST'] ? raise : exit(1) end |
#config ⇒ Object
25 26 27 28 |
# File 'lib/kubes/core.rb', line 25 def config Config.instance.load_configs Config.instance.config end |
#configure(&block) ⇒ Object
21 22 23 |
# File 'lib/kubes/core.rb', line 21 def configure(&block) Config.instance.configure(&block) end |
#deep_merge!(a, b) ⇒ Object
wrapper to ensure we use the same deeper_merge options everywhere
47 48 49 50 |
# File 'lib/kubes/core.rb', line 47 def deep_merge!(a, b) a.deeper_merge!(b, config.merger.) a end |
#env ⇒ Object
9 10 11 |
# File 'lib/kubes/core.rb', line 9 def env ENV['KUBES_ENV'].blank? ? "dev" : ENV['KUBES_ENV'] end |
#extra ⇒ Object
13 14 15 |
# File 'lib/kubes/core.rb', line 13 def extra ENV['KUBES_EXTRA'] unless ENV['KUBES_EXTRA'].blank? end |
#kustomize? ⇒ Boolean
36 37 38 |
# File 'lib/kubes/core.rb', line 36 def kustomize? Kubectl::Kustomize.detect? end |
#logger ⇒ Object
31 32 33 |
# File 'lib/kubes/core.rb', line 31 def logger config.logger end |
#root ⇒ Object
17 18 19 |
# File 'lib/kubes/core.rb', line 17 def root ENV['KUBES_ROOT'] || Dir.pwd end |