Sha256: ef718f5e2e75494a279a2336f3ba7413746bb6354af98de7ec16be97385e8761

Contents?: true

Size: 1.72 KB

Versions: 8

Compression:

Stored size: 1.72 KB

Contents

require 'commander'
require 'sct/command'

module Sct
    class CommandsGenerator
        include Commander::Methods

        def self.start
            self.new.run
        end

        def run 
            program :name, 'sct'
            program :version, Sct::VERSION
            program :summary, 'CLI helper tool for local SCT development'
            program :description, 'SCT is a CLI tool for developers using the Visma Continuous Deployment Model in conjunction with the Google Cloud Platform (GCP). It provides multiple command to set up and maintain a kubernetes cluster on a machine for local development'

            global_option('--verbose') { $verbose = true }

            command :init do |c| 
                c.syntax = 'sct init'
                c.description = 'setup sct'

                c.action do |args, options| 
                    UI.important("setting up sct")
                    Sct::InitCommand.new.execute(args, options)
                end
            end

            command :hostfile do |c|

                c.syntax = 'sct hostfile'
                c.description = 'patch hostfile with kubernetes ip'

                c.action do |args, options|
                    UI.important("Trying to patch hostfile")
                    Sct::HostfileCommand.new.execute(args, options)
                end
            end

            command :'mysql proxy' do |c|

                c.syntax = 'sct mysql proxy'
                c.description = 'setup google mysql proxy'

                c.action do |args, options| 
                    UI.important("Trying to setup mysql proxy")
                    Sct::MysqlproxyCommand.new.execute(args, options)
                end

            end

            run!
        end
    end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sct-0.1.26 sct/lib/sct/commands_generator.rb
sct-0.1.25 sct/lib/sct/commands_generator.rb
sct-0.1.24 sct/lib/sct/commands_generator.rb
sct-0.1.23 sct/lib/sct/commands_generator.rb
sct-0.1.22 sct/lib/sct/commands_generator.rb
sct-0.1.21 sct/lib/sct/commands_generator.rb
sct-0.1.20 sct/lib/sct/commands_generator.rb
sct-0.1.19 sct/lib/sct/commands_generator.rb