diff options
Diffstat (limited to 'app/services/deployments')
-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 |