Class: Captive::Commands::DbExec
- Inherits:
-
Object
- Object
- Captive::Commands::DbExec
- Defined in:
- lib/captive/commands/db_exec.rb
Instance Method Summary collapse
-
#initialize(kubectl:, target: DbTarget.new(kubectl: kubectl)) ⇒ DbExec
constructor
A new instance of DbExec.
- #run(app, file, single_transaction: true) ⇒ Object
Constructor Details
Instance Method Details
#run(app, file, single_transaction: true) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/captive/commands/db_exec.rb', line 14 def run(app, file, single_transaction: true) pod, user, password = @target.resolve(app) ok = @kubectl.psql_file(app, pod, file, user: user, password: password, single_transaction: single_transaction) raise ExecError, "L'exécution de #{file} a échoué" if ok == false file end |