jarl 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jarl/application.rb +4 -4
- data/lib/jarl/cli.rb +3 -3
- data/lib/jarl/docker.rb +3 -2
- data/lib/jarl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39d4273e5c3caa559ada160310841928e641fa3c
|
4
|
+
data.tar.gz: 863c55376488f1c7665e48a351589cf307e6273f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e49477ccd2c56038bcb9fa94e43c1ba4f37c80f7926914ef7a056ae2cf46db716b9f65b96140e7ff5239ba5a75b7eb2474fd09a80cb96bfe05b8d6ed0dcf803
|
7
|
+
data.tar.gz: 3fd1f54f435e7b73a2c9991de47a97ae5272b427d196bb2e9c7502cf61e05dc081476b0c74d56c5effa6c5ef7b717fa38e1a8ad3e6d803d18fb78da46fc795fd
|
data/lib/jarl/application.rb
CHANGED
@@ -87,9 +87,9 @@ module Jarl
|
|
87
87
|
)
|
88
88
|
end
|
89
89
|
|
90
|
-
def ssh
|
90
|
+
def ssh(command = nil)
|
91
91
|
fail 'Not a running application' unless running?
|
92
|
-
instances.first.ssh
|
92
|
+
instances.first.ssh(command)
|
93
93
|
end
|
94
94
|
|
95
95
|
def build
|
@@ -158,8 +158,8 @@ module Jarl
|
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
161
|
-
def ssh
|
162
|
-
container.open_ssh_session!(Jarl.config.params)
|
161
|
+
def ssh(command = nil)
|
162
|
+
container.open_ssh_session!(Jarl.config.params, command)
|
163
163
|
end
|
164
164
|
|
165
165
|
def self.start(application, n = nil)
|
data/lib/jarl/cli.rb
CHANGED
@@ -76,13 +76,13 @@ module Jarl
|
|
76
76
|
end
|
77
77
|
|
78
78
|
#
|
79
|
-
desc 'ssh NAME', 'Open SSH session to a running application'
|
80
|
-
def ssh(name)
|
79
|
+
desc 'ssh NAME [COMMAND ...]', 'Open an interactive SSH session to a running application or execute a command and exit'
|
80
|
+
def ssh(name, command = nil, *args)
|
81
81
|
Jarl.load(options)
|
82
82
|
app = Jarl.find_applications_by(name).first
|
83
83
|
abort "Failed to find application by name: '#{name}'" unless app
|
84
84
|
abort "Application is not running: '#{app.full_name}'" unless app.running?
|
85
|
-
app.ssh
|
85
|
+
app.ssh([command] + args)
|
86
86
|
end
|
87
87
|
|
88
88
|
#
|
data/lib/jarl/docker.rb
CHANGED
@@ -219,7 +219,7 @@ module Docker
|
|
219
219
|
end
|
220
220
|
end
|
221
221
|
|
222
|
-
def open_ssh_session!(params = {})
|
222
|
+
def open_ssh_session!(params = {}, command = nil)
|
223
223
|
ssh_flags = ['-oStrictHostKeyChecking=no']
|
224
224
|
if params['ssh_identity']
|
225
225
|
ssh_flags << "-i #{params['ssh_identity']}" if params['ssh_identity'].is_a?(String)
|
@@ -228,7 +228,8 @@ module Docker
|
|
228
228
|
end
|
229
229
|
end
|
230
230
|
ssh_user = params['ssh_user'] ? "#{params['ssh_user']}@" : ''
|
231
|
-
|
231
|
+
ssh_cmd = command ? "-C \"#{command.join(' ')}\"" : ''
|
232
|
+
sh "ssh #{ssh_flags.join(' ')} #{ssh_user}#{ip} #{ssh_cmd}"
|
232
233
|
end
|
233
234
|
|
234
235
|
def stop!
|
data/lib/jarl/version.rb
CHANGED