Class: SecretsFetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/renuo/cli/app/secrets_fetcher.rb

Constant Summary collapse

CONFIG_FILE =
"config/1password-secrets.yml"

Instance Method Summary collapse

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/renuo/cli/app/secrets_fetcher.rb', line 10

def run
  unless ENV["CI"]
    system("which op > /dev/null") || abort("op is not installed. Please install it (e.g. brew install " \
                                            "1password-cli).")
  end

  abort("Config file #{CONFIG_FILE} not found.") unless File.exist?(CONFIG_FILE)
  config = YAML.load_file(CONFIG_FILE).deep_symbolize_keys

  config[:items].each do |item|
    elaborate_item(item)
  end
end