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
fba38b51
Commit
fba38b51
authored
Nov 27, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature flag
parent
f5bfedc6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
app/models/ci/build.rb
app/models/ci/build.rb
+2
-0
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+17
-2
No files found.
app/models/ci/build.rb
View file @
fba38b51
...
@@ -485,6 +485,8 @@ module Ci
...
@@ -485,6 +485,8 @@ module Ci
end
end
def
validates_dependencies!
def
validates_dependencies!
return
unless
Feature
.
enabled?
(
'ci_validates_dependencies'
)
dependencies
.
tap
do
|
deps
|
dependencies
.
tap
do
|
deps
|
# When `dependencies` keyword is given and depended jobs are skipped by `only` keyword
# When `dependencies` keyword is given and depended jobs are skipped by `only` keyword
if
options
[
:dependencies
]
&
.
any?
&&
deps
.
empty?
if
options
[
:dependencies
]
&
.
any?
&&
deps
.
empty?
...
...
doc/ci/yaml/README.md
View file @
fba38b51
...
@@ -1106,8 +1106,7 @@ Note that `artifacts` from all previous [stages](#stages) are passed by default.
...
@@ -1106,8 +1106,7 @@ Note that `artifacts` from all previous [stages](#stages) are passed by default.
To use this feature, define
`dependencies`
in context of the job and pass
To use this feature, define
`dependencies`
in context of the job and pass
a list of all previous jobs from which the artifacts should be downloaded.
a list of all previous jobs from which the artifacts should be downloaded.
You can only define jobs from stages that are executed before the current one.
You can only define jobs from stages that are executed before the current one.
An error will be shown if you define jobs from the current stage or next ones,
An error will be shown if you define jobs from the current stage or next ones.
or there are no depended jobs with artifacts in previous stages.
Defining an empty array will skip downloading any artifacts for that job.
Defining an empty array will skip downloading any artifacts for that job.
The status of the previous job is not considered when using
`dependencies`
, so
The status of the previous job is not considered when using
`dependencies`
, so
if it failed or it is a manual job that was not run, no error occurs.
if it failed or it is a manual job that was not run, no error occurs.
...
@@ -1154,6 +1153,22 @@ deploy:
...
@@ -1154,6 +1153,22 @@ deploy:
script
:
make deploy
script
:
make deploy
```
```
### Validations for `dependencies` keyword
> Introduced in GitLab 10.3
`dependencies`
keyword doesn't check the depended
`artifacts`
strictly. Therefore
they do not fail even though it falls into the following conditions.
1.
A depended
`artifacts`
has been
[
erased
](
https://docs.gitlab.com/ee/api/jobs.html#erase-a-job
)
.
1.
A depended
`artifacts`
has been
[
expired
](
https://docs.gitlab.com/ee/ci/yaml/#artifacts-expire_in
)
.
To validate those conditions, you can flip the feature flag from a rails console:
```
Feature.enable('ci_validates_dependencies')
```
### before_script and after_script
### before_script and after_script
It's possible to overwrite the globally defined
`before_script`
and
`after_script`
:
It's possible to overwrite the globally defined
`before_script`
and
`after_script`
:
...
...
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