Method: Codebuild::Core#set_aws_profile!

Defined in:
lib/codebuild/core.rb

#set_aws_profile!Object

Overrides AWS_PROFILE based on the Codebuild.env if set in configs/settings.yml 2-way binding.



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/codebuild/core.rb', line 31

def set_aws_profile!
  return if ENV['TEST']
  return unless File.exist?("#{Codebuild.root}/.codebuild/settings.yml") # for rake docs
  return unless settings # Only load if within Codebuild project and there's a settings.yml

  data = settings || {}
  if data[:aws_profile]
    puts "Using AWS_PROFILE=#{data[:aws_profile]} from CB_ENV=#{Codebuild.env} in config/settings.yml"
    ENV['AWS_PROFILE'] = data[:aws_profile]
  end
end