shopapp 0.2.17 → 0.2.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5b6a99909f0e75c891df09ad77f5dfdd8c6e89b3928eac7a31ec287ef50069f
4
- data.tar.gz: be03ef0e5a368136e2ccd1a584295c4f92355a2a3aab15e5b746eac9f03850df
3
+ metadata.gz: 876cd7a6b9cbee9402cd690d1776cef227fb0c55896cdf6dcee6b64aac94bdaf
4
+ data.tar.gz: 1ec768685ecad0f93ed1fd5849dc6c5152beb6b83096c2fe5d1d5975d072aab8
5
5
  SHA512:
6
- metadata.gz: f3b1aa4a9b0aaf7ac1c21ff7aa413bd7721b2f1a01f7322304fff85cbe787d21a541fe1e82df689033b65612a206108d64f1d205453d1dd418f9bb3375988a62
7
- data.tar.gz: e875a3ec805da57afe14b87e1904ec40450f026be2c8d7d6261fcc95e1058badd19168946b84d61654e5cac0464e0ad533bf603237e57c0f102298960b055e59
6
+ metadata.gz: 6878e4cd64bc57d577f2d75e26abc7601d113a59618aee73f66075d3f08881d7155f4f19b8ca1b0bbbf63fd2ed3a15eb7669e2918d63797c1f464a083eac8870
7
+ data.tar.gz: d89d1edbf5f6f013590f4d407ec8385797dcdb31e65ed041a8b4760e7d831b54b7fda0dcb2b408dd4879658f7ee39b160ec87b8ccf59443e75b28fc9d115312e
@@ -2,17 +2,34 @@ namespace :shopapp do
2
2
  desc 'pull prod db to local dev'
3
3
  task pulldb: :environment do
4
4
  timestamp = Time.now.strftime('%Y%m%d%H%M%S')
5
- user = Rails.configuration.settings['production_dbuser'] || Rails.configuration.settings['production_user']
5
+ user = Rails.configuration.settings['production_dbuser'] || Rails.configuration.settings['production_user']
6
6
  server = Rails.configuration.settings['production_dbserver'] || Rails.configuration.settings['production_server']
7
7
  db_name = Rails.configuration.database_configuration['production']['database']
8
8
  dev_db_name = Rails.configuration.database_configuration['development']['database']
9
9
  dump_filename = "#{db_name}_#{timestamp}.dump"
10
10
 
11
- puts "Create production db backup with #{dump_filename}"
11
+ puts "Creating production db backup to #{dump_filename}..."
12
12
  system "ssh #{user}@#{server} 'pg_dump -Fc -c #{db_name} > #{dump_filename}'"
13
13
  mkdir_p Rails.root.join('tmp')
14
+ puts "Copying to local..."
14
15
  system "scp #{user}@#{server}:#{dump_filename} #{Rails.root.join('tmp')}"
16
+ puts "Restoring to local development database..."
15
17
  system "pg_restore --verbose -c --dbname #{dev_db_name} #{Rails.root.join('tmp', dump_filename)}"
16
- puts 'Restored production database to local'
18
+ puts 'Restored production database to local development.'
19
+ end
20
+
21
+ desc 'execute command on production server'
22
+ task run: :environment do
23
+ ARGV.each { |a| task a.to_sym do ; end }
24
+ user = Rails.configuration.settings['production_user']
25
+ server = Rails.configuration.settings['production_server']
26
+
27
+ deployment_folder_name = (Rails.configuration.settings['deployment_folder']) ||
28
+ "#{(Rails.configuration.settings['shopapp_name'] ||
29
+ Rails.application.class.parent_name).to_s.downcase.parameterize.underscore}/current"
30
+
31
+ cmd = %(ssh -t #{user}@#{server} 'cd #{deployment_folder_name}; bash --login -c "#{ARGV[1..-1].join(' ')}"')
32
+ #puts cmd
33
+ exec cmd
17
34
  end
18
35
  end
data/shopapp.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'shopapp'
3
- s.version = '0.2.17'
4
- s.date = '2019-01-06'
3
+ s.version = '0.2.18'
4
+ s.date = '2019-01-07'
5
5
  s.summary = 'Do a shoplift.'
6
6
  s.description = 'Ha! Art thou Bedlam? Dost thou thirst base Trojan, to have me fold up Parca\'s fatal web? Hence!\
7
7
  I am qualmish at the smell of leek.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.17
4
+ version: 0.2.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zeljko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-06 00:00:00.000000000 Z
11
+ date: 2019-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties