diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /app/services/deployments/update_environment_service.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'app/services/deployments/update_environment_service.rb')
-rw-r--r-- | app/services/deployments/update_environment_service.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/services/deployments/update_environment_service.rb b/app/services/deployments/update_environment_service.rb index 3cacedc7d6e..90a31ae9370 100644 --- a/app/services/deployments/update_environment_service.rb +++ b/app/services/deployments/update_environment_service.rb @@ -61,6 +61,12 @@ module Deployments ExpandVariables.expand(environment_url, -> { variables.sort_and_expand_all }) end + def expanded_auto_stop_in + return unless auto_stop_in + + ExpandVariables.expand(auto_stop_in, -> { variables.sort_and_expand_all }) + end + def environment_url environment_options[:url] end @@ -69,6 +75,10 @@ module Deployments environment_options[:action] || 'start' end + def auto_stop_in + deployable&.environment_auto_stop_in + end + def renew_external_url if (url = expanded_environment_url) environment.external_url = url @@ -78,7 +88,9 @@ module Deployments def renew_auto_stop_in return unless deployable - environment.auto_stop_in = deployable.environment_auto_stop_in + if (value = expanded_auto_stop_in) + environment.auto_stop_in = value + end end def renew_deployment_tier |