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
Boxiang Sun
gitlab-ce
Commits
c03631a9
Commit
c03631a9
authored
Sep 17, 2018
by
Shinya Maeda
Committed by
Alessio Caiazza
Oct 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support new syntax
parent
3fc4c096
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
18 deletions
+19
-18
app/models/ci/build.rb
app/models/ci/build.rb
+8
-7
app/services/ci/process_pipeline_service.rb
app/services/ci/process_pipeline_service.rb
+1
-1
lib/gitlab/ci/config/entry/job.rb
lib/gitlab/ci/config/entry/job.rb
+6
-6
lib/gitlab/ci/status/build/delayed.rb
lib/gitlab/ci/status/build/delayed.rb
+2
-2
lib/gitlab/ci/status/build/factory.rb
lib/gitlab/ci/status/build/factory.rb
+1
-1
lib/gitlab/ci/yaml_processor.rb
lib/gitlab/ci/yaml_processor.rb
+1
-1
No files found.
app/models/ci/build.rb
View file @
c03631a9
...
...
@@ -186,6 +186,7 @@ module Ci
end
after_transition
any
=>
[
:manual
]
do
|
build
|
puts
"
#{
self
.
class
.
name
}
-
#{
__callee__
}
: 1"
build
.
run_after_commit
do
build
.
schedule_delayed_execution
end
...
...
@@ -236,22 +237,22 @@ module Ci
action?
&&
(
manual?
||
retryable?
)
end
def
autoplay
?
manual?
&&
options
[
:
autoplay
_in
].
present?
def
delayed
?
manual?
&&
options
[
:
start
_in
].
present?
end
def
autoplay
_at
ChronicDuration
.
parse
(
options
[
:
autoplay
_in
])
&
.
seconds
&
.
from_now
def
execute
_at
ChronicDuration
.
parse
(
options
[
:
start
_in
])
&
.
seconds
&
.
from_now
end
def
schedule_delayed_execution
return
unless
autoplay
?
return
unless
delayed
?
create_build_schedule!
(
execute_at:
autoplay
_at
)
create_build_schedule!
(
execute_at:
execute
_at
)
end
def
action?
self
.
when
==
'manual'
self
.
when
==
'manual'
||
self
.
when
==
'delayed'
end
# rubocop: disable CodeReuse/ServiceClass
...
...
app/services/ci/process_pipeline_service.rb
View file @
c03631a9
...
...
@@ -53,7 +53,7 @@ module Ci
%w[failed]
when
'always'
%w[success failed skipped]
when
'manual'
when
'manual'
,
'delayed'
%w[success skipped]
else
[]
...
...
lib/gitlab/ci/config/entry/job.rb
View file @
c03631a9
...
...
@@ -10,7 +10,7 @@ module Gitlab
include
Attributable
ALLOWED_KEYS
=
%i[tags script only except type image services
allow_failure type stage when
autoplay
_in artifacts cache
allow_failure type stage when
start
_in artifacts cache
dependencies before_script after_script variables
environment coverage retry extends]
.
freeze
...
...
@@ -28,7 +28,7 @@ module Gitlab
greater_than_or_equal_to:
0
,
less_than_or_equal_to:
2
}
validates
:when
,
inclusion:
{
in:
%w[on_success on_failure always manual]
,
inclusion:
{
in:
%w[on_success on_failure always manual
delayed
]
,
message:
'should be on_success, on_failure, '
\
'always or manual'
}
...
...
@@ -36,11 +36,11 @@ module Gitlab
validates
:extends
,
type:
String
with_options
if: :manual_action?
do
validates
:
autoplay
_in
,
duration:
true
,
allow_nil:
true
validates
:
start
_in
,
duration:
true
,
allow_nil:
true
end
with_options
unless: :manual_action?
do
validates
:
autoplay
_in
,
presence:
false
validates
:
start
_in
,
presence:
false
end
end
end
...
...
@@ -92,7 +92,7 @@ module Gitlab
:artifacts
,
:commands
,
:environment
,
:coverage
,
:retry
attributes
:script
,
:tags
,
:allow_failure
,
:when
,
:dependencies
,
:retry
,
:extends
,
:
autoplay
_in
:retry
,
:extends
,
:
start
_in
def
compose!
(
deps
=
nil
)
super
do
...
...
@@ -119,7 +119,7 @@ module Gitlab
end
def
manual_action?
self
.
when
==
'manual'
self
.
when
==
'manual'
||
self
.
when
==
'delayed'
end
def
ignored?
...
...
lib/gitlab/ci/status/build/
manual_with_auto_play
.rb
→
lib/gitlab/ci/status/build/
delayed
.rb
View file @
c03631a9
...
...
@@ -2,7 +2,7 @@ module Gitlab
module
Ci
module
Status
module
Build
class
ManualWithAutoPlay
<
Status
::
Extended
class
Delayed
<
Status
::
Extended
###
# TODO: Those are random values. We have to fix accoding to the UX review
###
...
...
@@ -43,7 +43,7 @@ module Gitlab
end
def
self
.
matches?
(
build
,
user
)
build
.
autoplay
?
&&
!
build
.
canceled?
build
.
delayed
?
&&
!
build
.
canceled?
end
end
end
...
...
lib/gitlab/ci/status/build/factory.rb
View file @
c03631a9
...
...
@@ -5,7 +5,7 @@ module Gitlab
class
Factory
<
Status
::
Factory
def
self
.
extended_statuses
[[
Status
::
Build
::
Erased
,
Status
::
Build
::
ManualWithAutoPlay
,
Status
::
Build
::
Delayed
,
Status
::
Build
::
Manual
,
Status
::
Build
::
Canceled
,
Status
::
Build
::
Created
,
...
...
lib/gitlab/ci/yaml_processor.rb
View file @
c03631a9
...
...
@@ -50,7 +50,7 @@ module Gitlab
after_script:
job
[
:after_script
],
environment:
job
[
:environment
],
retry:
job
[
:retry
],
autoplay_in:
job
[
:autoplay
_in
],
start_in:
job
[
:start
_in
],
}.
compact
}
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