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

deployment.rb « data_builder « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f11e032ab843aa888115cb0359448647abccf007 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

module Gitlab
  module DataBuilder
    module Deployment
      extend self

      def build(deployment)
        {
          object_kind: 'deployment',
          status: deployment.status,
          deployable_id: deployment.deployable_id,
          deployable_url: Gitlab::UrlBuilder.build(deployment.deployable),
          environment: deployment.environment.name,
          project: deployment.project.hook_attrs,
          short_sha: deployment.short_sha,
          user: deployment.user.hook_attrs,
          user_url: Gitlab::UrlBuilder.build(deployment.user),
          commit_url: Gitlab::UrlBuilder.build(deployment.commit),
          commit_title: deployment.commit.title
        }
      end
    end
  end
end