Skip to content

Commit 6d96bf3

Browse files
committed
1 parent 45f8a5e commit 6d96bf3

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

github3/repos/deployment.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
3-
from json import loads
43

54
from github3.models import GitHubCore
65
from github3.users import User
@@ -21,6 +20,10 @@ def __init__(self, deployment, session=None):
2120
#: SHA of the branch on GitHub
2221
self.sha = deployment.get('sha')
2322

23+
#: The reference used to create the Deployment, e.g.,
24+
#: `deploy-20140526`
25+
self.ref = deployment.get('ref')
26+
2427
#: User object representing the creator of the deployment
2528
self.creator = deployment.get('creator')
2629
if self.creator:
@@ -38,6 +41,9 @@ def __init__(self, deployment, session=None):
3841
#: Description of the deployment
3942
self.description = deployment.get('description')
4043

44+
#: Target for the deployment, e.g., 'production', 'staging'
45+
self.environment = deployment.get('environment')
46+
4147
#: URL to get the statuses of this deployment
4248
self.statuses_url = deployment.get('statuses_url')
4349

@@ -113,5 +119,14 @@ def __init__(self, status, session=None):
113119
#: Description of the deployment
114120
self.description = status.get('description')
115121

122+
#: :class:`Deployment` representing the deployment this status is
123+
#: associated with
124+
self.deployment = status.get('deployment')
125+
if self.deployment:
126+
self.deployment = Deployment(self.deployment, self)
127+
128+
#: URL for the deployment this status is associated with
129+
self.deployment_url = status.get('deployment_url')
130+
116131
def _repr(self):
117132
return '<DeploymentStatus [{0}]>'.format(self.id)

0 commit comments

Comments
 (0)