Class: SwarmClusterCliOpe::SyncConfigs::PostGres
- Inherits:
-
BaseDatabase
- Object
- Thor::Shell::Basic
- Base
- BaseDatabase
- SwarmClusterCliOpe::SyncConfigs::PostGres
- Defined in:
- lib/swarm_cluster_cli_ope/sync_configs/post_gres.rb
Direct Known Subclasses
Defined Under Namespace
Classes: EnvConfigs
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from BaseDatabase
Methods inherited from Base
Methods included from LoggerConcern
Constructor Details
This class inherits a constructor from SwarmClusterCliOpe::SyncConfigs::Base
Instance Method Details
#pull ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/swarm_cluster_cli_ope/sync_configs/post_gres.rb', line 5 def pull resume('pull') if yes?("Confermare il comando?[y,yes]") tmp_file = "/tmp/#{Time.now.to_i}.sql.gz" dump_cmd(remote, tmp_file) local.container.copy_in(tmp_file, tmp_file) # drop old db and recreate # if Gem::Version.new(local.database_version) <= Gem::Version.new("12") close_connections_and_drop_cmd(local) # else # raise "DA ANALIZZARE QUANDO LA 13 disponibile....dropdb ha un force come parametro" # end create_cmd(local) restore_cmd(local, tmp_file) end true end |
#push ⇒ TrueClass, FalseClass
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/swarm_cluster_cli_ope/sync_configs/post_gres.rb', line 30 def push resume('PUSH') if yes?("ATTENZIONE !!!!!!PUSH!!!!! - Confermare il comando?[y,yes]") tmp_file = "/tmp/#{Time.now.to_i}.sql.gz" dump_cmd(local, tmp_file) remote.container.copy_in(tmp_file, tmp_file) close_connections_and_drop_cmd(remote) create_cmd(remote) restore_cmd(remote, tmp_file) end true end |