aptible-cli 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/aptible-cli.gemspec +2 -2
- data/lib/aptible/cli/agent.rb +4 -0
- data/lib/aptible/cli/helpers/operation.rb +0 -1
- data/lib/aptible/cli/subcommands/config.rb +2 -0
- data/lib/aptible/cli/subcommands/rebuild.rb +25 -0
- data/lib/aptible/cli/subcommands/restart.rb +25 -0
- data/lib/aptible/cli/subcommands/tunnel.rb +3 -1
- data/lib/aptible/cli/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8fdc0e031ed20f6fa6ace7447351b6390ca0570
|
4
|
+
data.tar.gz: 239283ab9b3631162c089d068392dfd50e4c708e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97e7e0f9092b65921d299fa2ea0102ce90cf169e9e978fbe82c6c2f2de5abf81a21169faaf91597e374be53a0f942244ea1e35acda7a52cf0d84de9419703b9c
|
7
|
+
data.tar.gz: e26cd49d39e8d27b9f87149b7d2048da4028ae69e7944a61e06ad78e2ae9d4f8cefdc3bd20cf667ef0d69613509c12a061a5a9e44188da97124144c05d2cbff0
|
data/aptible-cli.gemspec
CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.version = Aptible::CLI::VERSION
|
11
11
|
spec.authors = ['Frank Macreery']
|
12
12
|
spec.email = ['frank@macreery.com']
|
13
|
-
spec.description =
|
14
|
-
spec.summary =
|
13
|
+
spec.description = 'Aptible CLI'
|
14
|
+
spec.summary = 'Command-line interface for Aptible services'
|
15
15
|
spec.homepage = 'https://github.com/aptible/aptible-cli'
|
16
16
|
spec.license = 'MIT'
|
17
17
|
|
data/lib/aptible/cli/agent.rb
CHANGED
@@ -9,6 +9,8 @@ require_relative 'helpers/app'
|
|
9
9
|
|
10
10
|
require_relative 'subcommands/apps'
|
11
11
|
require_relative 'subcommands/config'
|
12
|
+
require_relative 'subcommands/rebuild'
|
13
|
+
require_relative 'subcommands/restart'
|
12
14
|
require_relative 'subcommands/ssh'
|
13
15
|
require_relative 'subcommands/tunnel'
|
14
16
|
|
@@ -20,6 +22,8 @@ module Aptible
|
|
20
22
|
include Helpers::Token
|
21
23
|
include Subcommands::Apps
|
22
24
|
include Subcommands::Config
|
25
|
+
include Subcommands::Rebuild
|
26
|
+
include Subcommands::Restart
|
23
27
|
include Subcommands::SSH
|
24
28
|
include Subcommands::Tunnel
|
25
29
|
|
@@ -27,6 +27,7 @@ module Aptible
|
|
27
27
|
app = ensure_app(options)
|
28
28
|
env = Hash[args.map { |arg| arg.split('=', 2) }]
|
29
29
|
operation = app.create_operation(type: 'configure', env: env)
|
30
|
+
puts 'Updating configuration and restarting app...'
|
30
31
|
poll_for_success(operation)
|
31
32
|
end
|
32
33
|
|
@@ -37,6 +38,7 @@ module Aptible
|
|
37
38
|
app = ensure_app(options)
|
38
39
|
env = Hash[args.map { |arg| [arg, ''] }]
|
39
40
|
operation = app.create_operation(type: 'configure', env: env)
|
41
|
+
puts 'Updating configuration and restarting app...'
|
40
42
|
poll_for_success(operation)
|
41
43
|
end
|
42
44
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Aptible
|
2
|
+
module CLI
|
3
|
+
module Subcommands
|
4
|
+
module Rebuild
|
5
|
+
# rubocop:disable MethodLength
|
6
|
+
def self.included(thor)
|
7
|
+
thor.class_eval do
|
8
|
+
include Helpers::Operation
|
9
|
+
include Helpers::App
|
10
|
+
|
11
|
+
desc 'rebuild', 'Rebuild an app, and restart its services'
|
12
|
+
option :app
|
13
|
+
def rebuild
|
14
|
+
app = ensure_app(options)
|
15
|
+
operation = app.create_operation(type: 'rebuild')
|
16
|
+
puts 'Rebuilding app...'
|
17
|
+
poll_for_success(operation)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
# rubocop:enable MethodLength
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Aptible
|
2
|
+
module CLI
|
3
|
+
module Subcommands
|
4
|
+
module Restart
|
5
|
+
# rubocop:disable MethodLength
|
6
|
+
def self.included(thor)
|
7
|
+
thor.class_eval do
|
8
|
+
include Helpers::Operation
|
9
|
+
include Helpers::App
|
10
|
+
|
11
|
+
desc 'restart', 'Restart all services associated with an app'
|
12
|
+
option :app
|
13
|
+
def restart
|
14
|
+
app = ensure_app(options)
|
15
|
+
operation = app.create_operation(type: 'restart')
|
16
|
+
puts 'Restarting app...'
|
17
|
+
poll_for_success(operation)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
# rubocop:enable MethodLength
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -22,7 +22,9 @@ module Aptible
|
|
22
22
|
tunnel_args = "-L #{local_port}:localhost:#{remote_port}"
|
23
23
|
connection_args = "-o 'SendEnv=*' -p #{port} root@#{host}"
|
24
24
|
puts "Creating tunnel at localhost:#{local_port}..."
|
25
|
-
|
25
|
+
opts = " -o 'SendEnv=*' -o StrictHostKeyChecking=no " \
|
26
|
+
'-o UserKnownHostsFile=/dev/null'
|
27
|
+
Kernel.exec "ssh #{opts} #{tunnel_args} #{connection_args}"
|
26
28
|
end
|
27
29
|
|
28
30
|
private
|
data/lib/aptible/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aptible-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frank Macreery
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aptible-api
|
@@ -147,6 +147,8 @@ files:
|
|
147
147
|
- lib/aptible/cli/helpers/token.rb
|
148
148
|
- lib/aptible/cli/subcommands/apps.rb
|
149
149
|
- lib/aptible/cli/subcommands/config.rb
|
150
|
+
- lib/aptible/cli/subcommands/rebuild.rb
|
151
|
+
- lib/aptible/cli/subcommands/restart.rb
|
150
152
|
- lib/aptible/cli/subcommands/ssh.rb
|
151
153
|
- lib/aptible/cli/subcommands/tunnel.rb
|
152
154
|
- lib/aptible/cli/version.rb
|
@@ -179,3 +181,4 @@ summary: Command-line interface for Aptible services
|
|
179
181
|
test_files:
|
180
182
|
- spec/aptible/cli/agent_spec.rb
|
181
183
|
- spec/spec_helper.rb
|
184
|
+
has_rdoc:
|