2016-11-03 07:54:10 -04:00
|
|
|
class DeploymentEntity < Grape::Entity
|
|
|
|
include RequestAwareEntity
|
|
|
|
|
|
|
|
expose :id
|
|
|
|
expose :iid
|
|
|
|
expose :sha
|
|
|
|
|
|
|
|
expose :ref do
|
|
|
|
expose :name do |deployment|
|
|
|
|
deployment.ref
|
|
|
|
end
|
2017-04-24 16:34:36 -04:00
|
|
|
|
|
|
|
expose :ref_path do |deployment|
|
|
|
|
namespace_project_tree_path(
|
|
|
|
deployment.project.namespace,
|
|
|
|
deployment.project,
|
|
|
|
id: deployment.ref)
|
|
|
|
end
|
2016-11-03 07:54:10 -04:00
|
|
|
end
|
|
|
|
|
2017-03-28 06:48:53 -04:00
|
|
|
expose :created_at
|
2016-11-03 07:54:10 -04:00
|
|
|
expose :tag
|
|
|
|
expose :last?
|
2017-04-24 16:34:36 -04:00
|
|
|
|
|
|
|
expose :user, using: UserEntity
|
|
|
|
expose :commit, using: CommitEntity
|
2017-06-07 05:36:41 -04:00
|
|
|
expose :deployable, using: JobEntity
|
|
|
|
expose :manual_actions, using: JobEntity
|
2016-11-03 07:54:10 -04:00
|
|
|
end
|