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:
authorTiger <twatson@gitlab.com>2019-03-04 02:56:20 +0300
committerTiger <twatson@gitlab.com>2019-03-20 04:04:40 +0300
commit00f0d356b71fa87f8190810b01add0cc4586e90a (patch)
treee6b59c822bba6db3ea1e80079e644d010b84f806 /app/workers/ci
parent42ca9c6f0de34dfa7ae09cc0e9672ea5857afd38 (diff)
Create framework for build prerequisites
Introduces the concept of Prerequisites for a CI build. If a build has unmet prerequisites it will go through the :preparing state before being made available to a runner. There are no actual prerequisites yet, so current behaviour is unchanged.
Diffstat (limited to 'app/workers/ci')
-rw-r--r--app/workers/ci/build_prepare_worker.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/workers/ci/build_prepare_worker.rb b/app/workers/ci/build_prepare_worker.rb
new file mode 100644
index 00000000000..1a35a74ae53
--- /dev/null
+++ b/app/workers/ci/build_prepare_worker.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+module Ci
+ class BuildPrepareWorker
+ include ApplicationWorker
+ include PipelineQueue
+
+ queue_namespace :pipeline_processing
+
+ def perform(build_id)
+ Ci::Build.find_by_id(build_id).try do |build|
+ Ci::PrepareBuildService.new(build).execute
+ end
+ end
+ end
+end