class ElasticDot::Command::Services

Public Class Methods

create(args, opts) click to toggle source
# File lib/elasticdot/command/services.rb, line 2
def self.create(args, opts)
  info = api.post '/domains', domain: args[0], type: 'service'

  if info['error']
    puts info['error']
    exit 1
  end

  puts "Creating service app #{info['app_name']}... done"
  puts info['app_repo']

  create_git_remote 'elasticdot', info['app_repo']
end
destroy(opts) click to toggle source
# File lib/elasticdot/command/services.rb, line 16
def self.destroy(opts)
  find_app! opts

  spinner "Destroying app #{@app}..." do
    api.delete "/domains/#{@app}"
  end
end
info(opts) click to toggle source
# File lib/elasticdot/command/services.rb, line 24
def self.info(opts)
  find_app! opts

  h = api.get "/domains/#{@app}"

  puts "=== #{@app}"
  puts
  puts "Git URL:\t#{h['git_repo']}"
  puts "Owner Email:\t#{h['owner_email']}"
  puts "Region:\t\tEU"
  #   puts "Slug Size:\t#{h['slug_size']}"
end
list() click to toggle source
# File lib/elasticdot/command/services.rb, line 37
def self.list
  apps = api.get "/apps?type=service"
  puts '=== My Services'
  apps.each { |app| puts app }
end