1
1
# -*- coding: utf-8 -*-
2
2
from __future__ import unicode_literals
3
- from json import loads
4
3
5
4
from github3 .models import GitHubCore
6
5
from github3 .users import User
@@ -21,6 +20,10 @@ def __init__(self, deployment, session=None):
21
20
#: SHA of the branch on GitHub
22
21
self .sha = deployment .get ('sha' )
23
22
23
+ #: The reference used to create the Deployment, e.g.,
24
+ #: `deploy-20140526`
25
+ self .ref = deployment .get ('ref' )
26
+
24
27
#: User object representing the creator of the deployment
25
28
self .creator = deployment .get ('creator' )
26
29
if self .creator :
@@ -38,6 +41,9 @@ def __init__(self, deployment, session=None):
38
41
#: Description of the deployment
39
42
self .description = deployment .get ('description' )
40
43
44
+ #: Target for the deployment, e.g., 'production', 'staging'
45
+ self .environment = deployment .get ('environment' )
46
+
41
47
#: URL to get the statuses of this deployment
42
48
self .statuses_url = deployment .get ('statuses_url' )
43
49
@@ -113,5 +119,14 @@ def __init__(self, status, session=None):
113
119
#: Description of the deployment
114
120
self .description = status .get ('description' )
115
121
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
+
116
131
def _repr (self ):
117
132
return '<DeploymentStatus [{0}]>' .format (self .id )
0 commit comments