Sha256: ca0fd38320efe86043b56668a6854eeeddacaaa96174e6ddea4547daa9c1e36c

Contents?: true

Size: 891 Bytes

Versions: 15

Compression:

Stored size: 891 Bytes

Contents

require 'sct/command_interface'
require 'sct/command_option'
require "sct/config"
require "sct/setup/helpers"

module Sct

  class Mysql_proxyCommand
    
    DEFAULT_SECRET_NAME = "gcloud-credentials"

    IS_PUBLIC_COMMAND = true
    SYNTAX = 'sct mysql_proxy'
    SUMMARY = 'adds a secret for the mysql proxy'
    DESCRIPTION = ""
    EXAMPLE = ""
    EXAMPLE_DESCRIPTION = ""
    OPTIONS = []    

    def execute(args, options)

      return puts "SCT has not been initialized. Run 'sct init' first.".red unless Sct::Config.exists
      
      path = Sct::Config.get('cloud-proxy-path')

      system("kubectl delete secret gcloud-credentials")
      system("kubectl create secret generic gcloud-credentials --from-file=#{path}")
      
      puts "Authenticated with secret-name: '#{DEFAULT_SECRET_NAME}'".green

      return true
    end

    implements CommandInterface
  
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sct-0.1.18 lib/sct/commands/mysqlproxy.rb
sct-0.1.17 lib/sct/commands/mysqlproxy.rb
sct-0.1.16 lib/sct/commands/mysqlproxy.rb
sct-0.1.15 lib/sct/commands/mysqlproxy.rb
sct-0.1.14 lib/sct/commands/mysqlproxy.rb
sct-0.1.13 lib/sct/commands/mysqlproxy.rb
sct-0.1.12 lib/sct/commands/mysqlproxy.rb
sct-0.1.11 lib/sct/commands/mysqlproxy.rb
sct-0.1.10 lib/sct/commands/mysqlproxy.rb
sct-0.1.9 lib/sct/commands/mysqlproxy.rb
sct-0.1.8 lib/sct/commands/mysqlproxy.rb
sct-0.1.7 lib/sct/commands/mysqlproxy.rb
sct-0.1.6 lib/sct/commands/mysqlproxy.rb
sct-0.1.5 lib/sct/commands/mysqlproxy.rb
sct-0.1.4 lib/sct/commands/mysqlproxy.rb