Method: Codebuild::Dsl::Project#linux_environment

Defined in:
lib/codebuild/dsl/project.rb

#linux_environment(options = {}) ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/codebuild/dsl/project.rb', line 69

def linux_environment(options={})
  image = options[:image] || "aws/codebuild/ruby:2.5.3-1.7.0"
  env = {
    compute_type: options[:compute_type] || "BUILD_GENERAL1_SMALL",
    image_pull_credentials_type: "CODEBUILD", # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-imagepullcredentialstype
    privileged_mode: true,
    image: image,
    type: "LINUX_CONTAINER"
  }
  # @mapped_env_vars is in memory
  env[:environment_variables] = @mapped_env_vars if @mapped_env_vars
  # options has highest precedence
  env[:environment_variables] = options[:environment_variables] if options[:environment_variables]
  @properties[:environment] = env
end