Sha256: ff97c5bde8155d0a751463f2e073c9d46362411fa04a4ce748d935a5919b2906

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

require 'trollop'

module SimplePerf
  module CLI
    class StartCustom
      include Shared

      def execute
        opts = Trollop::options do
          version SimplePerf::VERSION
          banner <<-EOS

Starts JMeter or Gatling with custom shell script.

Usage:
      simple_perf start_custom -e ENVIRONMENT -n STACK_NAME
EOS
          opt :help, "Display Help"
          opt :environment, "Set the target environment", :type => :string
          opt :name, "Stack name to manage", :type => :string
        end
        Trollop::die :environment, "is required but not specified" unless opts[:environment]
        Trollop::die :name, "is required but not specified" unless opts[:name]

        config = Config.new.environment opts[:environment]

        ENV['SIMPLE_DEPLOY_SSH_KEY'] = config['local_pem']
        ENV['SIMPLE_DEPLOY_SSH_USER'] = config['user']

        command = 'simple_deploy execute' +
                    ' -e ' + opts[:environment] +
                    ' -n ' + opts[:name] +
                    ' -c "cd ~/simple_perf_test_files; nohup ./start_custom.sh > start_custom.log  &"' +
                    ' -l debug'

        Shared::pretty_print `#{command}`
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_perf-0.0.5 lib/simple_perf/cli/start_custom.rb