Sha256: 0e325eb74a7894cc91212cbcc58575bce43fa25b4601459466105a7b9e8573be

Contents?: true

Size: 1.26 KB

Versions: 9

Compression:

Stored size: 1.26 KB

Contents

require_relative 'context-knife-context'

module Context
  module DeployKnifeConstant
    def organisation_name
      'deploy-context'
    end

    def context_name
      'deploy-context'
    end

    def context_folder
      File.join(ENV['HOME'], 'deploy-context')
    end
  end

  class DeployKnifeContext < Manager
    banner "knife deploy knife context"

    deps do
      Knife::DefaultKnifeContext.load_deps
    end

    option :omg,
      :short => '-O',
      :long => '--omg',
      :description => "I'm so excited! 9"

    def run
      if config[:omg]
        puts "OMG HELLO WORLD!!!9!!99"
      else
        puts "I am just a fucking example. 9"
      end
    end
  end

  class DeployContext < Manager
    include DeployKnifeConstant
    banner "knife deploy context"

    deps do
      Knife::DefaultKnifeContext.load_deps
    end

    def run
      run_cmd = if name_args.empty?
        warning_context_log 'Deploy Context', 'No argumet passed'
        show_help(self)
        []
      else
        warning_context_log 'Deploy Context', name_args
        tmp_cmd = %w(knife context) + [name_args[0], 'studio']
        if name_args[1].nil?
          tmp_cmd
        else
          tmp_cmd + name_args[1...]
        end
      end
      execute_command(run_cmd)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
deploy-context-2.13.39 x86_64-linux/lib/deploy-context.rb
deploy-context-2.13.38 x86_64-linux/lib/deploy-context.rb
deploy-context-2.13.36 x86_64-linux/lib/deploy-context.rb
deploy-context-2.13.35 x86_64-linux/lib/deploy-context.rb
deploy-context-2.13.34 x86_64-linux/lib/deploy-context.rb
deploy-context-2.13.26 /home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context.rb
deploy-context-2.13.25 /home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context.rb
deploy-context-2.13.17 /home/jimboadmin/deploy-context/habitat/plan.sh/x86_64-linux/lib/deploy-context.rb
deploy-context-2.13.8 /src/libraries/deploy-context/helpers/../../../libraries/deploy-context.rb