Class: Neetob::CLI::NeetoDeploy::ConfigVars::Upsert
- Defined in:
- lib/neetob/cli/neeto_deploy/config_vars/upsert.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#apps ⇒ Object
Returns the value of attribute apps.
-
#required_config_vars_json_file_path ⇒ Object
Returns the value of attribute required_config_vars_json_file_path.
-
#required_config_vars_with_project_keys_json_file_path ⇒ Object
Returns the value of attribute required_config_vars_with_project_keys_json_file_path.
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
Attributes inherited from Base
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(apps, required_config_vars_json_file_path, required_config_vars_with_project_keys_json_file_path, sandbox = false) ⇒ Upsert
constructor
A new instance of Upsert.
- #run ⇒ Object
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize(apps, required_config_vars_json_file_path, required_config_vars_with_project_keys_json_file_path, sandbox = false) ⇒ Upsert
Returns a new instance of Upsert.
13 14 15 16 17 18 19 20 21 |
# File 'lib/neetob/cli/neeto_deploy/config_vars/upsert.rb', line 13 def initialize(apps, required_config_vars_json_file_path, required_config_vars_with_project_keys_json_file_path, sandbox = false) super() @apps = apps @required_config_vars_json_file_path = required_config_vars_json_file_path @required_config_vars_with_project_keys_json_file_path = required_config_vars_with_project_keys_json_file_path @sandbox = sandbox end |
Instance Attribute Details
#apps ⇒ Object
Returns the value of attribute apps.
10 11 12 |
# File 'lib/neetob/cli/neeto_deploy/config_vars/upsert.rb', line 10 def apps @apps end |
#required_config_vars_json_file_path ⇒ Object
Returns the value of attribute required_config_vars_json_file_path.
10 11 12 |
# File 'lib/neetob/cli/neeto_deploy/config_vars/upsert.rb', line 10 def required_config_vars_json_file_path @required_config_vars_json_file_path end |
#required_config_vars_with_project_keys_json_file_path ⇒ Object
Returns the value of attribute required_config_vars_with_project_keys_json_file_path.
10 11 12 |
# File 'lib/neetob/cli/neeto_deploy/config_vars/upsert.rb', line 10 def required_config_vars_with_project_keys_json_file_path @required_config_vars_with_project_keys_json_file_path end |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
10 11 12 |
# File 'lib/neetob/cli/neeto_deploy/config_vars/upsert.rb', line 10 def sandbox @sandbox end |
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/neetob/cli/neeto_deploy/config_vars/upsert.rb', line 23 def run check_the_given_arguments inform_about_current_working_mode(sandbox) if apps.nil? apps_to_be_updated = apps.nil? ? read_json_file(required_config_vars_with_project_keys_json_file_path) : find_all_matching_apps_or_repos(apps, :neetodeploy, sandbox) inform_about_default_config_vars_file apps_to_be_updated.each do |app| required_config = apps.nil? ? app[1] : read_json_file(required_config_vars_json_file_path || default_config_vars_upsert_file_path) app = app[0] if apps.nil? if apps.nil? && sandbox && app != "neeto-dummy" ui.error("The \"#{app}\" app is not available in sandbox mode.") next end upsert_config_variables(app, required_config) end end |