gitlab-org--gitlab-foss/lib/gitlab/data_builder/deployment.rb
Jason Goodman 1b8646804d Update deployment chat message notification
Include link to user and commit title.
Rearrange text
2019-05-02 16:07:26 +00:00

25 lines
750 B
Ruby

# 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