Class: KuberKit::CLI
Class Method Summary collapse
Instance Method Summary collapse
- #apply(file_path) ⇒ Object
- #attach(pod_name) ⇒ Object
- #compile(image_names_str) ⇒ Object
- #deploy ⇒ Object
- #env(env_file_name) ⇒ Object
- #service(service_name) ⇒ Object
- #template(template_name) ⇒ Object
Class Method Details
.exit_on_failure? ⇒ Boolean
103 104 105 |
# File 'lib/kuber_kit/cli.rb', line 103 def self.exit_on_failure? true end |
Instance Method Details
#apply(file_path) ⇒ Object
86 87 88 89 90 91 92 |
# File 'lib/kuber_kit/cli.rb', line 86 def apply(file_path) KuberKit.set_debug_mode([:debug]) if KuberKit::Container['actions.configuration_loader'].call() KuberKit::Container['actions.kubectl_applier'].call(File.(file_path), ) end end |
#attach(pod_name) ⇒ Object
95 96 97 98 99 100 101 |
# File 'lib/kuber_kit/cli.rb', line 95 def attach(pod_name) KuberKit.set_debug_mode([:debug]) if KuberKit::Container['actions.configuration_loader'].call() KuberKit::Container['actions.kubectl_attacher'].call(pod_name, ) end end |
#compile(image_names_str) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/kuber_kit/cli.rb', line 12 def compile(image_names_str) KuberKit.set_debug_mode([:debug]) image_names = image_names_str.split(",").map(&:strip).map(&:to_sym) if KuberKit::Container['actions.configuration_loader'].call() result = KuberKit::Container['actions.image_compiler'].call(image_names, ) end logger = KuberKit::Container['tools.logger'] if result logger.info("---------------------------") logger.info("Image compilation finished!") logger.info("---------------------------") else logger.info("-------------------------".red) logger.info("Image compilation failed!".red) logger.info("-------------------------".red) end end |
#deploy ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/kuber_kit/cli.rb', line 36 def deploy KuberKit.set_debug_mode([:debug]) if KuberKit::Container['actions.configuration_loader'].call() result = KuberKit::Container['actions.service_deployer'].call( services: [:services] || [], tags: [:tags] || [] ) end logger = KuberKit::Container['tools.logger'] if result logger.info("---------------------------") logger.info("Service deployment finished!") logger.info("---------------------------") else logger.info("-------------------------".red) logger.info("Service deployment failed!".red) logger.info("-------------------------".red) end end |
#env(env_file_name) ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/kuber_kit/cli.rb', line 59 def env(env_file_name) KuberKit.set_debug_mode([:debug]) if KuberKit::Container['actions.configuration_loader'].call() KuberKit::Container['actions.env_file_reader'].call(env_file_name.to_sym, ) end end |
#service(service_name) ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/kuber_kit/cli.rb', line 77 def service(service_name) KuberKit.set_debug_mode([:debug]) if KuberKit::Container['actions.configuration_loader'].call() KuberKit::Container['actions.service_reader'].call(service_name.to_sym, ) end end |
#template(template_name) ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/kuber_kit/cli.rb', line 68 def template(template_name) KuberKit.set_debug_mode([:debug]) if KuberKit::Container['actions.configuration_loader'].call() KuberKit::Container['actions.template_reader'].call(template_name.to_sym, ) end end |