Sha256: cf927f652f3afafcdaee9c73a8bc901d636c1d7e50b9003538689d0811c0f2fa

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

require 'sct/command_interface'

module Sct

  class ClusterCommand
    
    IS_PUBLIC_COMMAND = true
    SYNTAX = 'sct cluster'
    SUMMARY = 'Starts or stops the minikube cluster'
    EXAMPLE = 'sct cluster up'
    EXAMPLE_DESCRIPTION = 'Starts the spend cloud cluster'
    DESCRIPTION = "Sct cluster allows you to start and stop the Spend Cloud minikube cluster"
    
    OPTIONS = []
    
    def initialize

    end

    def execute(args, options)
      case args[0]
        when "up"
          system("minikube start")
          system("minikube ssh -- 'sudo su -c \"echo 10048576 > /proc/sys/fs/inotify/max_user_watches\"'")
          system("kubectl delete pod -n kube-system $(kubectl get pods -n kube-system | grep registry-creds | awk '{print $1}')")
          puts "\nāœ”ļø  You can now visit your environment at šŸ‘‰ https://spend-cloud.spend.cloud.local šŸ‘Œ"
        when "down"
          system("minikube stop")
        else 
          puts "Unknown or missing argument. Please run 'sct cluster up' or 'sct cluster down'"
      end      
    end

    implements CommandInterface
  
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sct-0.1.2 lib/sct/commands/cluster.rb