diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2019-03-21 01:25:23 +0300 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2019-03-21 01:25:23 +0300 |
commit | 6a0702fe9382c2b3c4a72421054d46821a95c781 (patch) | |
tree | 9e72a10dfddcf1b93019e2903393dbc3edc0fb85 /app/services | |
parent | f7fcfc7720c5149e2fa6f027900503ae3f215bf1 (diff) | |
parent | 0c3df3b56973d78345c6791cc3882a50d916cbc8 (diff) |
Merge branch '57115-just-in-time-k8s-resource-creation' into 'master'
Create project-specific Kubernetes resources just-in-time
See merge request gitlab-org/gitlab-ce!25586
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/ci/prepare_build_service.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/services/ci/prepare_build_service.rb b/app/services/ci/prepare_build_service.rb new file mode 100644 index 00000000000..32f11438b79 --- /dev/null +++ b/app/services/ci/prepare_build_service.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Ci + class PrepareBuildService + attr_reader :build + + def initialize(build) + @build = build + end + + def execute + prerequisites.each(&:complete!) + + unless build.enqueue + build.drop!(:unmet_prerequisites) + end + end + + private + + def prerequisites + build.prerequisites + end + end +end |