Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/variables/builder/project.rb')
-rw-r--r--lib/gitlab/ci/variables/builder/project.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/gitlab/ci/variables/builder/project.rb b/lib/gitlab/ci/variables/builder/project.rb
new file mode 100644
index 00000000000..832e68ea6a2
--- /dev/null
+++ b/lib/gitlab/ci/variables/builder/project.rb
@@ -0,0 +1,25 @@
+# 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