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
70dd0802
Commit
70dd0802
authored
Jun 13, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate environment from the simple variables
parent
f6d1a695
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
+18
-11
app/models/ci/build.rb
app/models/ci/build.rb
+17
-10
app/models/ee/project.rb
app/models/ee/project.rb
+1
-1
No files found.
app/models/ci/build.rb
View file @
70dd0802
...
@@ -198,24 +198,25 @@ module Ci
...
@@ -198,24 +198,25 @@ module Ci
# Variables whose value does not depend on other variables
# Variables whose value does not depend on other variables
def
simple_variables
def
simple_variables
variables
(
with_environment:
false
)
end
# All variables, including those dependent on other variables
def
variables
(
with_environment:
true
)
variables
=
predefined_variables
variables
=
predefined_variables
variables
+=
project
.
predefined_variables
variables
+=
project
.
predefined_variables
variables
+=
pipeline
.
predefined_variables
variables
+=
pipeline
.
predefined_variables
variables
+=
runner
.
predefined_variables
if
runner
variables
+=
runner
.
predefined_variables
if
runner
variables
+=
project
.
container_registry_variables
variables
+=
project
.
container_registry_variables
variables
+=
project
.
deployment_variables
if
has_environment?
variables
+=
project
.
deployment_variables
if
has_environment?
variables
+=
persisted_environment_variables
if
with_environment
variables
+=
yaml_variables
variables
+=
yaml_variables
variables
+=
user_variables
variables
+=
user_variables
variables
+=
secret_variables
variables
+=
secret_variables
(
with_environment:
with_environment
)
variables
+=
trigger_request
.
user_variables
if
trigger_request
variables
+=
trigger_request
.
user_variables
if
trigger_request
variables
variables
end
end
# All variables, including those dependent on other variables
def
variables
simple_variables
.
concat
(
persisted_environment_variables
)
end
def
merge_request
def
merge_request
return
@merge_request
if
defined?
(
@merge_request
)
return
@merge_request
if
defined?
(
@merge_request
)
...
@@ -391,10 +392,16 @@ module Ci
...
@@ -391,10 +392,16 @@ module Ci
]
]
end
end
def
secret_variables
def
secret_variables
(
with_environment:
true
)
variables
=
project
.
secret_variables_for
(
ref:
ref
)
if
with_environment
variables
.
concat
(
project
.
secret_variables_for
(
project
.
secret_variables_for
(
ref:
ref
,
environment:
persisted_environment
)
ref:
ref
,
environment:
persisted_environment
))
.
map
(
&
:to_runner_variable
)
end
variables
.
map
(
&
:to_runner_variable
)
end
end
def
steps
def
steps
...
...
app/models/ee/project.rb
View file @
70dd0802
...
@@ -77,7 +77,7 @@ module EE
...
@@ -77,7 +77,7 @@ module EE
end
end
end
end
def
secret_variables_for
(
ref
:,
environment
:)
def
secret_variables_for
(
ref
:,
environment:
nil
)
query
=
super
query
=
super
# Full wildcard has the least priority
# Full wildcard has the least priority
...
...
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