prun-ops 0.2.10 → 0.2.11

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: 5030be1e9d9e6ee4454acb6febd9877e26122345
4
- data.tar.gz: 1f65f7ae29f60618f3ca8452eac1537cc7e578b8
3
+ metadata.gz: 67423974106f368510f030fb614ffc9f724b8c1a
4
+ data.tar.gz: 78509c073e43ad0955b477eefa23ce9b48775f9c
5
5
  SHA512:
6
- metadata.gz: cc106b90b6c5f593beaefdaaed138584f62ee87b303841af3dc714130a53009c835ddc023abf5f1c7debbda5bf6018e8558aa8961a43e187c950fbf8ff6ba5e4
7
- data.tar.gz: 4ce169dd09c676e5311e79a3a60a32b402358eb9df0560d3b2c06d5fdef142a4e5a5f7651975078bf636efb7d8c3f533ab0f2993a0979e463423914f1c7890e7
6
+ metadata.gz: 0a4fee7ea259e60f0614782bf9ead313d612bf23a659da5cfeace428d082b30df8873713a97c30c2aff91bd849c5addc9ed67423360b287a6e42e39895d870d0
7
+ data.tar.gz: a8b06a123a9b9cacfbbc4c06596bd91e08afe2833520e3c0333b9bc947785ee5a20daaec661cf63eb48e7c1657e65a5dabe91eef6e291b879faec275028073d8
@@ -60,6 +60,15 @@ task :rake, :remote_task do |task, args|
60
60
  end
61
61
  end
62
62
 
63
+ desc 'Uploads a file to /tmp folder. i.e.: cap staging scp[tmp/db.sql]'
64
+ task :scp, :file_path do |task, args|
65
+ on roles(:app) do |host|
66
+ run_locally do
67
+ scp host, args[:file_path]
68
+ end
69
+ end
70
+ end
71
+
63
72
 
64
73
  def run_in(host, remote_cmd)
65
74
  cmd = %w[ssh]
@@ -72,4 +81,17 @@ def run_in(host, remote_cmd)
72
81
  command = cmd.join(' ')
73
82
  Rails.logger.info command
74
83
  exec command
75
- end
84
+ end
85
+
86
+ def scp(host, file_path)
87
+ cmd = %w[scp]
88
+ opts = fetch(:ssh_options)
89
+ cmd << "-oProxyCommand='#{opts[:proxy].command_line_template}'" if opts
90
+ cmd << file_path
91
+ cmd << "#{host.user}@#{host.hostname}:/tmp"
92
+
93
+ command = cmd.join(' ')
94
+ Rails.logger.info command
95
+ exec command
96
+ end
97
+
@@ -1,3 +1,3 @@
1
1
  module PrunOps
2
- VERSION = "0.2.10"
2
+ VERSION = "0.2.11"
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.10
4
+ version: 0.2.11
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-10-19 00:00:00.000000000 Z
11
+ date: 2018-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler