Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
39412d0a
Commit
39412d0a
authored
Jun 01, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add deploy strategy related predefined variables
parent
5e9687a1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
app/models/project_auto_devops.rb
app/models/project_auto_devops.rb
+5
-0
spec/factories/project_auto_devops.rb
spec/factories/project_auto_devops.rb
+1
-0
spec/models/project_auto_devops_spec.rb
spec/models/project_auto_devops_spec.rb
+13
-0
No files found.
app/models/project_auto_devops.rb
View file @
39412d0a
...
@@ -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
spec/factories/project_auto_devops.rb
View file @
39412d0a
...
@@ -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
spec/models/project_auto_devops_spec.rb
View file @
39412d0a
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment