| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 40db4cd commit 8d7faf4
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,7 @@ API objects manipulation | |||
| 10 | 10 | gl_objects/builds | |
| 11 | 11 | gl_objects/commits | |
| 12 | 12 | gl_objects/deploy_keys | |
| 13 | + gl_objects/deployments | ||
| 13 | 14 | gl_objects/environments | |
| 14 | 15 | gl_objects/groups | |
| 15 | 16 | gl_objects/issues | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,11 @@ | |||
| 1 | + # list | ||
| 2 | + deployments = gl.project_deployments.list(project_id=1) | ||
| 3 | + # or | ||
| 4 | + deployments = project.deployments.list() | ||
| 5 | + # end list | ||
| 6 | + | ||
| 7 | + # get | ||
| 8 | + deployment = gl.project_deployments.get(deployment_id, project_id=1) | ||
| 9 | + # or | ||
| 10 | + deployment = project.deployments.get(deployment_id) | ||
| 11 | + # end get | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,23 @@ | |||
| 1 | + ########### | ||
| 2 | + Deployments | ||
| 3 | + ########### | ||
| 4 | + | ||
| 5 | + Use :class:`~gitlab.objects.ProjectDeployment` objects to manipulate project | ||
| 6 | + deployments. The :attr:`gitlab.Gitlab.project_deployments`, and | ||
| 7 | + :attr:`Project.deployments <gitlab.objects.Project.deployments>` manager | ||
| 8 | + objects provide helper functions. | ||
| 9 | + | ||
| 10 | + Examples | ||
| 11 | + -------- | ||
| 12 | + | ||
| 13 | + List deployments for a project: | ||
| 14 | + | ||
| 15 | + .. literalinclude:: deployments.py | ||
| 16 | + :start-after: # list | ||
| 17 | + :end-before: # end list | ||
| 18 | + | ||
| 19 | + Get a single deployment: | ||
| 20 | + | ||
| 21 | + .. literalinclude:: deployments.py | ||
| 22 | + :start-after: # get | ||
| 23 | + :end-before: # end get | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -92,6 +92,8 @@ class Gitlab(object): | |||
| 92 | 92 | GitLab projects commits comments | |
| 93 | 93 | project_commit_statuses (ProjectCommitStatusManager): Manager for | |
| 94 | 94 | GitLab projects commits statuses | |
| 95 | + project_deployments (ProjectDeploymentManager): Manager for GitLab | ||
| 96 | + projects deployments | ||
| 95 | 97 | project_keys (ProjectKeyManager): Manager for GitLab projects keys | |
| 96 | 98 | project_environments (ProjectEnvironmentManager): Manager for GitLab | |
| 97 | 99 | projects environments | |
@@ -178,6 +180,7 @@ def __init__(self, url, private_token=None, email=None, password=None, | |||
| 178 | 180 | self.project_commits = ProjectCommitManager(self) | |
| 179 | 181 | self.project_commit_comments = ProjectCommitCommentManager(self) | |
| 180 | 182 | self.project_commit_statuses = ProjectCommitStatusManager(self) | |
| 183 | + self.project_deployments = ProjectDeploymentManager(self) | ||
| 181 | 184 | self.project_keys = ProjectKeyManager(self) | |
| 182 | 185 | self.project_environments = ProjectEnvironmentManager(self) | |
| 183 | 186 | self.project_events = ProjectEventManager(self) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1862,6 +1862,17 @@ class ProjectAccessRequestManager(BaseManager): | |||
| 1862 | 1862 | obj_cls = ProjectAccessRequest | |
| 1863 | 1863 | ||
| 1864 | 1864 | ||
| 1865 | + class ProjectDeployment(GitlabObject): | ||
| 1866 | + _url = '/projects/%(project_id)s/deployments' | ||
| 1867 | + canCreate = False | ||
| 1868 | + canUpdate = False | ||
| 1869 | + canDelete = False | ||
| 1870 | + | ||
| 1871 | + | ||
| 1872 | + class ProjectDeploymentManager(BaseManager): | ||
| 1873 | + obj_cls = ProjectDeployment | ||
| 1874 | + | ||
| 1875 | + | ||
| 1865 | 1876 | class Project(GitlabObject): | |
| 1866 | 1877 | _url = '/projects' | |
| 1867 | 1878 | _constructorTypes = {'owner': 'User', 'namespace': 'Group'} | |
@@ -1890,6 +1901,7 @@ class Project(GitlabObject): | |||
| 1890 | 1901 | [('project_id', 'id')]), | |
| 1891 | 1902 | ('commit_statuses', ProjectCommitStatusManager, | |
| 1892 | 1903 | [('project_id', 'id')]), | |
| 1904 | + ('deployments', ProjectDeploymentManager, [('project_id', 'id')]), | ||
| 1893 | 1905 | ('environments', ProjectEnvironmentManager, [('project_id', 'id')]), | |
| 1894 | 1906 | ('events', ProjectEventManager, [('project_id', 'id')]), | |
| 1895 | 1907 | ('files', ProjectFileManager, [('project_id', 'id')]), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments