Sha256: bb8058f449c106779e9152fa91454630fc30bc52dfa8f60869b6e2917a6b7461

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

#!/usr/bin/env ruby

require "optparse"
require "cloud_runner/digital_ocean/cli/over"

options = {
  :client_id  => ENV["CR_CLIENT_ID"],
  :api_key    => ENV["CR_API_KEY"],
}

OptionParser.new do |p|
  p.on("-c", "--client-id CLIENT_ID", String,
       "DigitalOcean Client id / ENV['CR_CLIENT_ID']") do |v|
    options[:client_id] = v
  end

  p.on("-a", "--api-key API_KEY", String,
       "DigitalOcean API key / ENV['CR_API_KEY']") do |v|
    options[:api_key] = v
  end

  p.on("-d", "--droplet-id DROPLET_ID", String,
       "Droplet to find") do |v|
    options[:droplet_id] = v
  end

  p.on("-k", "--ssh-key SSH_KEY", String,
       "Path to SSH key for specified droplet") do |v|
    options[:ssh_key] = v
  end

  p.on("-s", "--script SCRIPT", String,
       "Path to script to run on specified droplet") do |v|
    options[:script] = v
  end

  p.on("-h", "--help", "Display this screen") do
    puts(p)
    exit
  end
end.parse!

exit CloudRunner::DigitalOcean::Cli::Over.new(options).run_script($stdout, $stderr)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cloud_runner-0.0.2 bin/cr-over