prun-ops 0.2.11 → 0.2.16

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
- SHA1:
3
- metadata.gz: 67423974106f368510f030fb614ffc9f724b8c1a
4
- data.tar.gz: 78509c073e43ad0955b477eefa23ce9b48775f9c
2
+ SHA256:
3
+ metadata.gz: f51451eb45ff7b7f66879651f250de2ce7d25f8d95482c943fb5adc0754af156
4
+ data.tar.gz: fc8f4ca5c032b26ae069728c34d6d4f1aff1182f7fec71fa682cd1016f5a9c6b
5
5
  SHA512:
6
- metadata.gz: 0a4fee7ea259e60f0614782bf9ead313d612bf23a659da5cfeace428d082b30df8873713a97c30c2aff91bd849c5addc9ed67423360b287a6e42e39895d870d0
7
- data.tar.gz: a8b06a123a9b9cacfbbc4c06596bd91e08afe2833520e3c0333b9bc947785ee5a20daaec661cf63eb48e7c1657e65a5dabe91eef6e291b879faec275028073d8
6
+ metadata.gz: ea66c9e692aa12d8f99304e7524298860f283ff1b1c4265ada9b120ba35e545be65dd9305911190fcc9b9f95d8b04421606bb121cf401cad40e173309c94c091
7
+ data.tar.gz: a486a131b75246484815fcb9f38645f21c5aaa9844683d6fb11f12b156bbb27c290da247b9d95db021d34fad3781a1cd6f585c79d9c99ce03b8de078aeb73e8f
@@ -5,6 +5,7 @@ task :config do
5
5
  invoke 'postgres:install'
6
6
  invoke 'nginx:install'
7
7
  invoke 'nodejs:install'
8
+ invoke 'yarn:install'
8
9
  invoke 'app:prepare'
9
10
  invoke 'deploy:upload_linked_files'
10
11
  # invoke 'app:db_prepare'
@@ -0,0 +1,12 @@
1
+ namespace :yarn do
2
+ task :install do
3
+ on roles :app do
4
+ execute <<-EOBLOCK
5
+ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
6
+ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
7
+ apt-get -qq update && apt-get install -y yarn
8
+ yarn install --check-files
9
+ EOBLOCK
10
+ end
11
+ end
12
+ end
@@ -60,11 +60,20 @@ 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|
63
+ desc 'Uploads a file to /tmp folder. i.e.: cap staging upload[tmp/db.sql]'
64
+ task :upload, :file_path do |task, args|
65
65
  on roles(:app) do |host|
66
66
  run_locally do
67
- scp host, args[:file_path]
67
+ upload_scp host, args[:file_path]
68
+ end
69
+ end
70
+ end
71
+
72
+ desc 'Downloads a file. i.e.: cap staging download[/tmp/db.sql]'
73
+ task :download, :file_path do |task, args|
74
+ on roles(:app) do |host|
75
+ run_locally do
76
+ download_scp host, args[:file_path]
68
77
  end
69
78
  end
70
79
  end
@@ -83,9 +92,10 @@ def run_in(host, remote_cmd)
83
92
  exec command
84
93
  end
85
94
 
86
- def scp(host, file_path)
95
+ def upload_scp(host, file_path)
87
96
  cmd = %w[scp]
88
97
  opts = fetch(:ssh_options)
98
+ cmd << "-r -o StrictHostKeyChecking=no"
89
99
  cmd << "-oProxyCommand='#{opts[:proxy].command_line_template}'" if opts
90
100
  cmd << file_path
91
101
  cmd << "#{host.user}@#{host.hostname}:/tmp"
@@ -95,3 +105,15 @@ def scp(host, file_path)
95
105
  exec command
96
106
  end
97
107
 
108
+ def download_scp(host, file_path)
109
+ cmd = %w[scp]
110
+ opts = fetch(:ssh_options)
111
+ cmd << "-oProxyCommand='#{opts[:proxy].command_line_template}'" if opts
112
+ cmd << "#{host.user}@#{host.hostname}:#{file_path}"
113
+ cmd << '.'
114
+
115
+ command = cmd.join(' ')
116
+ Rails.logger.info command
117
+ exec command
118
+ end
119
+
@@ -1,3 +1,3 @@
1
1
  module PrunOps
2
- VERSION = "0.2.11"
2
+ VERSION = "0.2.16"
3
3
  end
@@ -10,7 +10,7 @@ namespace :db do
10
10
 
11
11
  desc "Backup the database tp tmp/db.sql file"
12
12
  task backup: :get_db_config do
13
- sh "export PGPASSWORD=#{@password} && pg_dump #{@database} --host #{@host} -U #{@username} -f #{@default_filename}"
13
+ sh "export PGPASSWORD=#{@password} && pg_dump #{@database} --host #{@host} --port #{@port} -U #{@username} -f #{@default_filename}"
14
14
  end
15
15
 
16
16
  desc "Restore the database from tmp/db.sql file if no one is passed"
@@ -22,6 +22,7 @@ end
22
22
  task :get_db_config do
23
23
  config = Rails.configuration.database_configuration
24
24
  @host = config[Rails.env]["host"]
25
+ @port = config[Rails.env]["port"]
25
26
  @database = config[Rails.env]["database"]
26
27
  @username = config[Rails.env]["username"]
27
28
  @password = config[Rails.env]["password"]
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.11
4
+ version: 0.2.16
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-21 00:00:00.000000000 Z
11
+ date: 2020-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -123,6 +123,7 @@ files:
123
123
  - lib/capistrano/config/templates/vhost.conf.erb
124
124
  - lib/capistrano/config/templates/vhost_ssl.conf.erb
125
125
  - lib/capistrano/config/ubuntu.rake
126
+ - lib/capistrano/config/yarn.rake
126
127
  - lib/capistrano/diagnosis.rake
127
128
  - lib/capistrano/git.rake
128
129
  - lib/capistrano/prun-ops.rb
@@ -154,8 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
155
  - !ruby/object:Gem::Version
155
156
  version: '0'
156
157
  requirements: []
157
- rubyforge_project:
158
- rubygems_version: 2.4.5
158
+ rubygems_version: 3.0.6
159
159
  signing_key:
160
160
  specification_version: 4
161
161
  summary: Encapsulates Deployment and Manteinance Operations commands needed for a