Class: Jets::CLI

Inherits:
Thor::Base show all
Defined in:
lib/jets/cli.rb,
lib/jets/cli/ci.rb,
lib/jets/cli/env.rb,
lib/jets/cli/git.rb,
lib/jets/cli/tip.rb,
lib/jets/cli/url.rb,
lib/jets/cli/waf.rb,
lib/jets/cli/base.rb,
lib/jets/cli/call.rb,
lib/jets/cli/curl.rb,
lib/jets/cli/exec.rb,
lib/jets/cli/help.rb,
lib/jets/cli/init.rb,
lib/jets/cli/logs.rb,
lib/jets/cli/ping.rb,
lib/jets/cli/stop.rb,
lib/jets/cli/build.rb,
lib/jets/cli/clean.rb,
lib/jets/cli/login.rb,
lib/jets/cli/delete.rb,
lib/jets/cli/deploy.rb,
lib/jets/cli/dotenv.rb,
lib/jets/cli/logout.rb,
lib/jets/cli/stacks.rb,
lib/jets/cli/package.rb,
lib/jets/cli/release.rb,
lib/jets/cli/generate.rb,
lib/jets/cli/projects.rb,
lib/jets/cli/schedule.rb,
lib/jets/cli/teardown.rb,
lib/jets/cli/bootstrap.rb,
lib/jets/cli/functions.rb,
lib/jets/cli/concurrency.rb,
lib/jets/cli/maintenance.rb

Defined Under Namespace

Modules: Group, Help, Lambda Classes: Base, Bootstrap, Build, Call, Ci, Clean, Concurrency, Curl, Delete, Deploy, Dotenv, Env, Exec, Functions, Generate, Git, Init, Login, Logout, Logs, Maintenance, Package, Ping, Projects, Release, Schedule, Stacks, Stop, Teardown, Tip, Url, Waf

Instance Method Summary collapse

Methods inherited from Thor::Base

dispatch, exit_on_failure?, help_flags, version_flags, website

Methods included from Thor::Help

#capture_stdout_for_help, #help, #paginate_output

Instance Method Details

#bootstrapObject



44
45
46
# File 'lib/jets/cli.rb', line 44

def bootstrap
  Bootstrap.new(options).run
end

#buildObject



38
39
40
# File 'lib/jets/cli.rb', line 38

def build
  Build.new(options).run
end

#callObject



117
118
119
120
121
122
123
124
# File 'lib/jets/cli.rb', line 117

def call
  $stdout.sync = $stderr.sync = true
  $stdout = $stderr
  Call.new(options).run
rescue Jets::CLI::Call::Error => e
  puts "ERROR: #{e.message}".color(:red)
  abort "Unable to find the function.  Please check the function name and try again."
end

#cleanObject



49
50
51
# File 'lib/jets/cli.rb', line 49

def clean
  Clean.new(options).run
end

#curl(path) ⇒ Object



135
136
137
# File 'lib/jets/cli.rb', line 135

def curl(path)
  Curl.new(options.merge(path: path)).run
end

#deleteObject



62
63
64
# File 'lib/jets/cli.rb', line 62

def delete
  Delete.new(options).run
end

#deployObject



56
57
58
# File 'lib/jets/cli.rb', line 56

def deploy
  Deploy.new(options).run
end

#exec(*command) ⇒ Object



142
143
144
# File 'lib/jets/cli.rb', line 142

def exec(*command)
  Exec.new(options.merge(command: command)).run
end

#functionsObject



68
69
70
# File 'lib/jets/cli.rb', line 68

def functions
  Functions.new(options).run
end

#login(token = nil) ⇒ Object



90
91
92
# File 'lib/jets/cli.rb', line 90

def (token = nil)
  Login.new(options.merge(token: token)).run
end

#logoutObject



95
96
97
# File 'lib/jets/cli.rb', line 95

def logout
  Logout.new(options).run
end

#logsObject



108
109
110
# File 'lib/jets/cli.rb', line 108

def logs
  Logs.new(options).run
end

#pingObject



78
79
80
# File 'lib/jets/cli.rb', line 78

def ping
  Ping.new(options).run
end

#projectsObject



85
86
87
# File 'lib/jets/cli.rb', line 85

def projects
  Projects.new(options).run
end

#rollback(version) ⇒ Object



149
150
151
# File 'lib/jets/cli.rb', line 149

def rollback(version)
  Jets::CLI::Release::Rollback.new(options.merge(version: version)).run
end

#stacksObject



157
158
159
# File 'lib/jets/cli.rb', line 157

def stacks
  Stacks.new(options).run
end

#stopObject



163
164
165
# File 'lib/jets/cli.rb', line 163

def stop
  Stop.new(options).run
end

#teardownObject



171
172
173
174
175
# File 'lib/jets/cli.rb', line 171

def teardown
  warn "WARN: You should use `jets delete` instead of `jets teardown`".color(:yellow)
  warn "This is for debugging and will not delete the Jets API deployment record"
  Teardown.new(options).run
end

#urlObject



180
181
182
# File 'lib/jets/cli.rb', line 180

def url
  Url.new(options).run
end

#versionObject



185
186
187
# File 'lib/jets/cli.rb', line 185

def version
  puts "Jets #{VERSION}"
end