psenv/lib/psenv.rb

23 lines
565 B
Ruby

require "psenv/environment"
require "psenv/retriever"
require "psenv/version"
require "aws-sdk-ssm"
module Psenv
module_function
def load(*paths)
paths.unshift(ENV["PARAMETER_STORE_PATH"]) if ENV["PARAMETER_STORE_PATH"]
Environment.new(*paths.map { |path| retrieve_variables(path) }).apply
end
def overload(*paths)
paths.unshift(ENV["PARAMETER_STORE_PATH"]) if ENV["PARAMETER_STORE_PATH"]
Environment.new(*paths.map { |path| retrieve_variables(path) }).apply!
end
def retrieve_variables(path)
Retriever.new(path).call
end
end