Skip to content

Commit

Permalink
allow passwords to be passed to tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrock committed Jul 11, 2016
1 parent 0dcef4f commit 2a1402b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/tasks/evm_dba.rake
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ namespace :evm do
require 'trollop'
opts = Trollop.options(EvmDba.extract_command_options) do
opt :username, "Username", :type => :string
opt :password, "Password", :type => :string
opt :hostname, "Hostname", :type => :string
opt :dbname, "Database name", :type => :string
opt :aggressive, "Aggressive gc: vaccume with all options and reindexing"
Expand Down Expand Up @@ -216,6 +217,7 @@ namespace :evm do
opts = Trollop.options(EvmDba.extract_command_options) do
opt :local_file, "Destination file", :type => :string, :required => true
opt :username, "Username", :type => :string
opt :password, "Password", :type => :string
opt :hostname, "Hostname", :type => :string
opt :dbname, "Database name", :type => :string
end
Expand All @@ -235,12 +237,13 @@ namespace :evm do
opt :uri_password, "Destination depot password", :type => :string
opt :remote_file_name, "Destination depot filename", :type => :string
opt :username, "Username", :type => :string
opt :password, "Password", :type => :string
opt :hostname, "Hostname", :type => :string
opt :dbname, "Database name", :type => :string
end

db_opts = {}
[:dbname, :username, :hostname].each { |k| db_opts[k] = opts[k] if opts[k] }
[:dbname, :username, :password, :hostname].each { |k| db_opts[k] = opts[k] if opts[k] }

connect_opts = {}
[:uri, :uri_username, :uri_password, :remote_file_name].each { |k| connect_opts[k] = opts[k] if opts[k] }
Expand All @@ -260,6 +263,7 @@ namespace :evm do
opts = Trollop.options(EvmDba.extract_command_options) do
opt :local_file, "Destination file", :type => :string, :required => true
opt :username, "Username", :type => :string
opt :password, "Password", :type => :string
opt :hostname, "Hostname", :type => :string
opt :dbname, "Database name", :type => :string
end
Expand All @@ -282,12 +286,13 @@ namespace :evm do
opt :uri_username, "Destination depot username", :type => :string
opt :uri_password, "Destination depot password", :type => :string
opt :username, "Username", :type => :string
opt :password, "Password", :type => :string
opt :hostname, "Hostname", :type => :string
opt :dbname, "Database name", :type => :string
end

db_opts = {}
[:dbname, :username, :hostname].each { |k| db_opts[k] = opts[k] if opts[k] }
[:dbname, :username, :password, :hostname].each { |k| db_opts[k] = opts[k] if opts[k] }

connect_opts = {}
[:uri, :uri_username, :uri_password].each { |k| connect_opts[k] = opts[k] if opts[k] }
Expand Down

0 comments on commit 2a1402b

Please sign in to comment.