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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
8ab39eee
Commit
8ab39eee
authored
Nov 19, 2019
by
James Fargher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CI variable to show when Auto-DevOps is explicitly enabled
parent
c73479a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
app/models/project_auto_devops.rb
app/models/project_auto_devops.rb
+1
-0
changelogs/unreleased/auto_devops_enabled_ci_variable.yml
changelogs/unreleased/auto_devops_enabled_ci_variable.yml
+5
-0
spec/models/project_auto_devops_spec.rb
spec/models/project_auto_devops_spec.rb
+12
-1
No files found.
app/models/project_auto_devops.rb
View file @
8ab39eee
...
...
@@ -16,6 +16,7 @@ class ProjectAutoDevops < ApplicationRecord
def
predefined_variables
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
tap
do
|
variables
|
variables
.
append
(
key:
'AUTO_DEVOPS_EXPLICITLY_ENABLED'
,
value:
'1'
)
if
enabled?
variables
.
concat
(
deployment_strategy_default_variables
)
end
end
...
...
changelogs/unreleased/auto_devops_enabled_ci_variable.yml
0 → 100644
View file @
8ab39eee
---
title
:
Add CI variable to show when Auto-DevOps is explicitly enabled
merge_request
:
20332
author
:
type
:
changed
spec/models/project_auto_devops_spec.rb
View file @
8ab39eee
...
...
@@ -23,7 +23,8 @@ describe ProjectAutoDevops do
[
{
key:
'INCREMENTAL_ROLLOUT_MODE'
,
value:
'manual'
},
{
key:
'STAGING_ENABLED'
,
value:
'1'
},
{
key:
'INCREMENTAL_ROLLOUT_ENABLED'
,
value:
'1'
}
{
key:
'INCREMENTAL_ROLLOUT_ENABLED'
,
value:
'1'
},
{
key:
'AUTO_DEVOPS_EXPLICITLY_ENABLED'
,
value:
'1'
}
]
end
...
...
@@ -33,6 +34,8 @@ describe ProjectAutoDevops do
context
'when deploy_strategy is continuous'
do
let
(
:auto_devops
)
{
build_stubbed
(
:project_auto_devops
,
:continuous_deployment
,
project:
project
)
}
it
{
expect
(
auto_devops
.
predefined_variables
).
to
include
(
key:
'AUTO_DEVOPS_EXPLICITLY_ENABLED'
,
value:
'1'
)
}
it
do
expect
(
auto_devops
.
predefined_variables
.
map
{
|
var
|
var
[
:key
]
})
.
not_to
include
(
"STAGING_ENABLED"
,
"INCREMENTAL_ROLLOUT_ENABLED"
)
...
...
@@ -44,11 +47,19 @@ describe ProjectAutoDevops do
it
{
expect
(
auto_devops
.
predefined_variables
).
to
include
(
key:
'INCREMENTAL_ROLLOUT_MODE'
,
value:
'timed'
)
}
it
{
expect
(
auto_devops
.
predefined_variables
).
to
include
(
key:
'AUTO_DEVOPS_EXPLICITLY_ENABLED'
,
value:
'1'
)
}
it
do
expect
(
auto_devops
.
predefined_variables
.
map
{
|
var
|
var
[
:key
]
})
.
not_to
include
(
"STAGING_ENABLED"
,
"INCREMENTAL_ROLLOUT_ENABLED"
)
end
end
context
'when auto-devops is explicitly disabled'
do
let
(
:auto_devops
)
{
build_stubbed
(
:project_auto_devops
,
:disabled
,
project:
project
)
}
it
{
expect
(
auto_devops
.
predefined_variables
.
to_hash
).
to
be_empty
}
end
end
describe
'#create_gitlab_deploy_token'
do
...
...
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