debian-mirror-gitlab/lib/gitlab/ci/variables/builder/project.rb

26 lines
604 B
Ruby
Raw Normal View History

2022-04-04 11:22:00 +05:30
# frozen_string_literal: true
module Gitlab
module Ci
module Variables
class Builder
class Project
include Gitlab::Utils::StrongMemoize
def initialize(project)
@project = project
end
def secret_variables(environment:, protected_ref: false)
variables = @project.variables
variables = variables.unprotected unless protected_ref
variables = variables.for_environment(environment)
Gitlab::Ci::Variables::Collection.new(variables)
end
end
end
end
end
end