Sha256: 0350063f783539b39b28c0fe86ade4acbfa3ae2e13b46027eb13c001eecd5560

Contents?: true

Size: 1.82 KB

Versions: 3

Compression:

Stored size: 1.82 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 :'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

            command :'cluster' do |c|
                c.syntax = 'sct cluster'
                c.description = 'make changes to the cluster'
            end

            command :'shell' do |c|
                c.syntax = 'sct shell'
                c.description = 'run commands from the shell using docker containers'
            end

            command :'dev' do |c|
                c.syntax = 'sct dev'
                c.description = 'start development container in the current directory'
                c.option '--build', '(re)build images before starting'
                c.option '--pull', 'pull latest images before starting'

                c.action do |args, options|
                    Sct::DevCommand.new.execute args, options
                end
            end

            run!
        end
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sct-1.0.4 sct/lib/sct/commands_generator.rb
sct-1.0.2 sct/lib/sct/commands_generator.rb
sct-1.0.1 sct/lib/sct/commands_generator.rb