diff options
author | Tiger <twatson@gitlab.com> | 2019-03-04 02:56:20 +0300 |
---|---|---|
committer | Tiger <twatson@gitlab.com> | 2019-03-20 04:04:40 +0300 |
commit | 00f0d356b71fa87f8190810b01add0cc4586e90a (patch) | |
tree | e6b59c822bba6db3ea1e80079e644d010b84f806 /app/workers | |
parent | 42ca9c6f0de34dfa7ae09cc0e9672ea5857afd38 (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')
-rw-r--r-- | app/workers/all_queues.yml | 1 | ||||
-rw-r--r-- | app/workers/ci/build_prepare_worker.rb | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index b2d88567e0e..6ebd756d3da 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -71,6 +71,7 @@ - pipeline_hooks:build_hooks - pipeline_hooks:pipeline_hooks - pipeline_processing:build_finished +- pipeline_processing:ci_build_prepare - pipeline_processing:build_queue - pipeline_processing:build_success - pipeline_processing:pipeline_process 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 |