diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-12-10 16:25:49 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-12-12 12:34:17 +0300 |
commit | 320b6d965e59a0d732f516c6d821af7de60e8477 (patch) | |
tree | 25a9b85441fa19863ceeccd79854cb8429fb9fdb /app/models/ci | |
parent | f6d8fb6e46c5b966c04647d826ef43c018c5303b (diff) |
Add basic implementation of CI/CD bridge job
Diffstat (limited to 'app/models/ci')
-rw-r--r-- | app/models/ci/bridge.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb new file mode 100644 index 00000000000..22546d5d659 --- /dev/null +++ b/app/models/ci/bridge.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Ci + class Bridge < CommitStatus + include Importable + include AfterCommitQueue + include TokenAuthenticatable + include Gitlab::Utils::StrongMemoize + + belongs_to :project, inverse_of: :builds + + serialize :options # rubocop:disable Cop/ActiveRecordSerialize + validates :ref, presence: true + + before_save :ensure_token + + add_authentication_token_field :token, encrypted: true + + def self.retry(bridge, current_user) + raise NotImplementedError + end + + def tags + [:bridge] + end + + def detailed_status(current_user) + Gitlab::Ci::Status::Bridge::Factory + .new(self, current_user) + .fabricate! + end + + def predefined_variables + raise NotImplementedError + end + + def execute_hooks + raise NotImplementedError + end + end +end |