Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-07-17 17:38:37 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-07-17 17:38:37 +0300
commit65e722ee977a3fcd44fb272aa716dfa679385759 (patch)
tree3fee24a0e09670909df47163fc8d97fb2cc6380d /app/models/ci/pipeline_schedule.rb
parent550ccf443059412a26adfcba15fbe9d05d39a5f9 (diff)
parent05329d4a364a5c55f2de9546871de1909b6be3f5 (diff)
Merge remote-tracking branch 'upstream/master' into 30634-protected-pipeline
* upstream/master: (638 commits) Simplify background migrations stealing code Expire cached user IDs that can see the performance after 5 minutes Promote visibility level helpers from Group to Namespace Fix off-by-one error in background migration retries Recover from all exceptions when stealing bg migration Fix label creation from new list for subgroup projects move click handler to button. when on the icon it wasn't triggered in firefox Fix incorrect AWS ELB metrics. Fix wrong link to docs in docs styleguide Update issue-related docs Refactor groups docs Add subgroups limitations to Pages docs Update Google launcher details Split docs on IP whitelist for monitoring access Update health check docs Bump fog-core to 1.44.3 and fog providers' plugins to latest Introduce have_gitlab_http_status Remove Repository#search_files Update Pipeline's badge count in Merge Request and Commits view to match real-time content Fixes the user order being overriden in the autocomplete controller ...
Diffstat (limited to 'app/models/ci/pipeline_schedule.rb')
-rw-r--r--app/models/ci/pipeline_schedule.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/ci/pipeline_schedule.rb b/app/models/ci/pipeline_schedule.rb
index 49455e79c15..085eeeae157 100644
--- a/app/models/ci/pipeline_schedule.rb
+++ b/app/models/ci/pipeline_schedule.rb
@@ -9,17 +9,21 @@ module Ci
belongs_to :owner, class_name: 'User'
has_one :last_pipeline, -> { order(id: :desc) }, class_name: 'Ci::Pipeline'
has_many :pipelines
+ has_many :variables, class_name: 'Ci::PipelineScheduleVariable'
validates :cron, unless: :importing?, cron: true, presence: { unless: :importing? }
validates :cron_timezone, cron_timezone: true, presence: { unless: :importing? }
validates :ref, presence: { unless: :importing? }
validates :description, presence: true
+ validates :variables, variable_duplicates: true
before_save :set_next_run_at
scope :active, -> { where(active: true) }
scope :inactive, -> { where(active: false) }
+ accepts_nested_attributes_for :variables, allow_destroy: true
+
def owned_by?(current_user)
owner == current_user
end
@@ -52,5 +56,9 @@ module Ci
Gitlab::Ci::CronParser.new(worker_cron, worker_time_zone)
.next_time_from(next_run_at)
end
+
+ def job_variables
+ variables&.map(&:to_runner_variable) || []
+ end
end
end