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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-12 12:13:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-12 12:13:02 +0300
commitfc52f69f815eecbad9fcfe6b974f0c3e9c553828 (patch)
tree272c001c47ada803eb2844caa24a916b55f6f2d9 /lib/gitlab/ci/pipeline
parent04cc67da3e796c95dd72a3b725cc48f1e44bea3a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/ci/pipeline')
-rw-r--r--lib/gitlab/ci/pipeline/seed/environment.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/gitlab/ci/pipeline/seed/environment.rb b/lib/gitlab/ci/pipeline/seed/environment.rb
index 6bcc71a808b..8fb905d4c95 100644
--- a/lib/gitlab/ci/pipeline/seed/environment.rb
+++ b/lib/gitlab/ci/pipeline/seed/environment.rb
@@ -7,6 +7,8 @@ module Gitlab
class Environment < Seed::Base
attr_reader :job
+ delegate :simple_variables, to: :job
+
def initialize(job)
@job = job
end
@@ -14,7 +16,7 @@ module Gitlab
def to_resource
environments.safe_find_or_create_by(name: expanded_environment_name) do |environment|
# Initialize the attributes at creation
- environment.auto_stop_in = auto_stop_in
+ environment.auto_stop_in = expanded_auto_stop_in
environment.tier = deployment_tier
end
end
@@ -36,6 +38,12 @@ module Gitlab
def expanded_environment_name
job.expanded_environment_name
end
+
+ def expanded_auto_stop_in
+ return unless auto_stop_in
+
+ ExpandVariables.expand(auto_stop_in, -> { simple_variables.sort_and_expand_all })
+ end
end
end
end