summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/config/entry/job.rb
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-09-17 18:26:22 +0900
committerAlessio Caiazza <acaiazza@gitlab.com>2018-10-02 16:57:37 +0200
commit3fc4c096a592fbc0af3a8d60d2026ed673126a2f (patch)
treec886cf4b6a4b07c47576db4fb28e3c87f2907dae /lib/gitlab/ci/config/entry/job.rb
parentd5184e0d8b48bc221e1ea401b9171db07959b50c (diff)
downloadgitlab-ce-3fc4c096a592fbc0af3a8d60d2026ed673126a2f.tar.gz
Squashed commit of the following:
commit 9d9594ba20097dc4598f7eb42a9f9d78d73eae54 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Sep 13 20:18:31 2018 +0900 Cancel scheduled jobs commit f31c7172e07a9eb03b58c1e62eaa18cda4064aa6 Author: Shinya Maeda <shinya@gitlab.com> Date: Thu Sep 13 11:18:42 2018 +0900 Add Ci::BuildSchedule commit fb6b3ca638f40f9e1ee38b1fdd892bda4f6fede7 Author: Shinya Maeda <shinya@gitlab.com> Date: Wed Sep 12 20:02:50 2018 +0900 Scheduled jobs
Diffstat (limited to 'lib/gitlab/ci/config/entry/job.rb')
-rw-r--r--lib/gitlab/ci/config/entry/job.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/ci/config/entry/job.rb b/lib/gitlab/ci/config/entry/job.rb
index 016a896bde5..4376eb91a73 100644
--- a/lib/gitlab/ci/config/entry/job.rb
+++ b/lib/gitlab/ci/config/entry/job.rb
@@ -10,7 +10,7 @@ module Gitlab
include Attributable
ALLOWED_KEYS = %i[tags script only except type image services
- allow_failure type stage when artifacts cache
+ allow_failure type stage when autoplay_in artifacts cache
dependencies before_script after_script variables
environment coverage retry extends].freeze
@@ -34,6 +34,14 @@ module Gitlab
validates :dependencies, array_of_strings: true
validates :extends, type: String
+
+ with_options if: :manual_action? do
+ validates :autoplay_in, duration: true, allow_nil: true
+ end
+
+ with_options unless: :manual_action? do
+ validates :autoplay_in, presence: false
+ end
end
end
@@ -84,7 +92,7 @@ module Gitlab
:artifacts, :commands, :environment, :coverage, :retry
attributes :script, :tags, :allow_failure, :when, :dependencies,
- :retry, :extends
+ :retry, :extends, :autoplay_in
def compose!(deps = nil)
super do