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
|
|
|
|
|
2016-11-17 10:08:05 -05:00
|
|
|
expose :ref_path do |deployment|
|
|
|
|
namespace_project_tree_path(
|
2016-11-03 07:54:10 -04:00
|
|
|
deployment.project.namespace,
|
|
|
|
deployment.project,
|
|
|
|
id: deployment.ref)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :tag
|
|
|
|
expose :last?
|
2016-11-04 08:08:58 -04:00
|
|
|
expose :user, using: UserEntity
|
2016-11-03 07:54:10 -04:00
|
|
|
expose :commit, using: CommitEntity
|
|
|
|
expose :deployable, using: BuildEntity
|
2016-11-03 08:42:22 -04:00
|
|
|
expose :manual_actions, using: BuildEntity
|
2016-11-03 07:54:10 -04:00
|
|
|
end
|