Commit 39412d0a authored by Matija Čupić's avatar Matija Čupić

Add deploy strategy related predefined variables

parent 5e9687a1
...@@ -25,6 +25,11 @@ class ProjectAutoDevops < ActiveRecord::Base ...@@ -25,6 +25,11 @@ class ProjectAutoDevops < ActiveRecord::Base
variables.append(key: 'AUTO_DEVOPS_DOMAIN', variables.append(key: 'AUTO_DEVOPS_DOMAIN',
value: domain.presence || instance_domain) value: domain.presence || instance_domain)
end end
if continuous?
variables.append(key: 'STAGING_ENABLED', value: 1)
variables.append(key: 'INCREMENTAL_ROLLOUT_ENABLED', value: 1)
end
end end
end end
end end
...@@ -3,5 +3,6 @@ FactoryBot.define do ...@@ -3,5 +3,6 @@ FactoryBot.define do
project project
enabled true enabled true
domain "example.com" domain "example.com"
deploy_strategy :continuous
end end
end end
...@@ -69,6 +69,19 @@ describe ProjectAutoDevops do ...@@ -69,6 +69,19 @@ describe ProjectAutoDevops do
end end
end end
context 'when deploy_strategy is continuous' do
let(:domain) { 'example.com' }
before do
auto_devops.deploy_strategy = 'continuous'
end
it do
expect(auto_devops.predefined_variables.map { |var| var[:key] })
.to include("STAGING_ENABLED", "INCREMENTAL_ROLLOUT_ENABLED")
end
end
def domain_variable def domain_variable
{ key: 'AUTO_DEVOPS_DOMAIN', value: 'example.com', public: true } { key: 'AUTO_DEVOPS_DOMAIN', value: 'example.com', public: true }
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment