prun-ops 0.2.8 → 0.2.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ebcfc083174bb91532c650f414f73c456c8d86d
4
- data.tar.gz: b83ac8094cf2757018a8a8966121935beab289f6
3
+ metadata.gz: 4cc369b566bb02ccc1fe78b58f15cbd0f4f4b141
4
+ data.tar.gz: 779f55d7d14fa2acb5d97844855a66c1e2cc4388
5
5
  SHA512:
6
- metadata.gz: da8e9b077caa59fbb71f96d7506e428df4f6f329f0e6cc85171839e7191a1188d515a57df0352557fd30f5b8556661d37f26d2e5c027ca2c01e31b93763e740e
7
- data.tar.gz: fda4d523e7f79ae1fcb1bb5c1392017eecf8fc0520dace652eb902839c7835be19eca86c155c1b6389f0bf2b90807345fcfb9565848d19ab042b1029e49f7656
6
+ metadata.gz: 3ee5dfdc858b45b521fb08cf2d67cf741f8a3428f7e9a3e288e7325224a204c236967a2e2b04237ccb053666d9492d74271dccbb3e70ecca2d5855e3a7e22308
7
+ data.tar.gz: 22c0b2437a0f2613baa87704b913dcace2913c1f58a1feb2d02377bdc14d489267f269611f83a13a09f28e3c1963b7f3b8fe4b6ce1db95db07aa791583b0ecca
data/README.md CHANGED
@@ -54,6 +54,12 @@ server "example.com", user: 'root', roles: %w{web app db}, port: 2222
54
54
 
55
55
  Note: Remember change this line in production.rb file: `config.assets.compile = true`
56
56
 
57
+ If you are accessing your server through a bastion you can define it:
58
+
59
+ ```
60
+ bastion 'bastion.example.com', user: 'user'
61
+ ```
62
+
57
63
  ### Configuration
58
64
 
59
65
  Main task is `cap [stg] config`
@@ -243,3 +249,7 @@ require 'capistrano/prun-ops'
243
249
  ### v0.2.0
244
250
 
245
251
  * Configuration tasks: Add `cap stage config` and other tasks.
252
+
253
+ ### v0.2.8
254
+
255
+ * Bastion command
@@ -61,6 +61,12 @@ task :rake, :remote_task do |task, args|
61
61
  end
62
62
 
63
63
 
64
- def run_in(host, cmd)
65
- exec "ssh #{host.user}@#{host.hostname} -p #{host.port || '22'} -tt '#{cmd}'"
64
+ def run_in(host, remote_cmd)
65
+ cmd = %w[ssh]
66
+ opts = fetch(:ssh_options)
67
+ cmd << "-oProxyCommand='#{opts[:proxy].command_line_template}'" if opts
68
+ cmd << "#{host.user}@#{host.hostname}"
69
+ cmd << "-p #{host.port || '22'}"
70
+ cmd << "-tt '#{remote_cmd}'"
71
+ exec cmd.join(' ')
66
72
  end
@@ -16,3 +16,10 @@ def template(template_name, target_path)
16
16
  execute "sudo cp #{tmp_file} #{target_path}"
17
17
  execute "rm #{tmp_file}"
18
18
  end
19
+
20
+ ## Bastion config
21
+ def bastion(host, user:)
22
+ require 'net/ssh/proxy/command'
23
+ ssh_command = "ssh -W %h:%p -o StrictHostKeyChecking=no #{user}@#{host}"
24
+ set :ssh_options, proxy: Net::SSH::Proxy::Command.new(ssh_command)
25
+ end
@@ -1,3 +1,3 @@
1
1
  module PrunOps
2
- VERSION = "0.2.8"
2
+ VERSION = "0.2.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prun-ops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Lebrijo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-24 00:00:00.000000000 Z
11
+ date: 2018-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler