@@ -563,8 +563,8 @@ class ProjectBranchManager(BaseManager):
563
563
obj_cls = ProjectBranch
564
564
565
565
566
- class ProjectBuild (GitlabObject ):
567
- _url = '/projects/%(project_id)s/builds '
566
+ class ProjectJob (GitlabObject ):
567
+ _url = '/projects/%(project_id)s/jobs '
568
568
_constructorTypes = {'user' : 'User' ,
569
569
'commit' : 'ProjectCommit' ,
570
570
'runner' : 'Runner' }
@@ -574,28 +574,28 @@ class ProjectBuild(GitlabObject):
574
574
canCreate = False
575
575
576
576
def cancel (self , ** kwargs ):
577
- """Cancel the build ."""
578
- url = '/projects/%s/builds /%s/cancel' % (self .project_id , self .id )
577
+ """Cancel the job ."""
578
+ url = '/projects/%s/jobs /%s/cancel' % (self .project_id , self .id )
579
579
r = self .gitlab ._raw_post (url )
580
- raise_error_from_response (r , GitlabBuildCancelError , 201 )
580
+ raise_error_from_response (r , GitlabJobCancelError , 201 )
581
581
582
582
def retry (self , ** kwargs ):
583
- """Retry the build ."""
584
- url = '/projects/%s/builds /%s/retry' % (self .project_id , self .id )
583
+ """Retry the job ."""
584
+ url = '/projects/%s/jobs /%s/retry' % (self .project_id , self .id )
585
585
r = self .gitlab ._raw_post (url )
586
- raise_error_from_response (r , GitlabBuildRetryError , 201 )
586
+ raise_error_from_response (r , GitlabJobRetryError , 201 )
587
587
588
588
def play (self , ** kwargs ):
589
- """Trigger a build explicitly."""
590
- url = '/projects/%s/builds /%s/play' % (self .project_id , self .id )
589
+ """Trigger a job explicitly."""
590
+ url = '/projects/%s/jobs /%s/play' % (self .project_id , self .id )
591
591
r = self .gitlab ._raw_post (url )
592
- raise_error_from_response (r , GitlabBuildPlayError )
592
+ raise_error_from_response (r , GitlabJobPlayError )
593
593
594
594
def erase (self , ** kwargs ):
595
- """Erase the build (remove build artifacts and trace)."""
596
- url = '/projects/%s/builds /%s/erase' % (self .project_id , self .id )
595
+ """Erase the job (remove job artifacts and trace)."""
596
+ url = '/projects/%s/jobs /%s/erase' % (self .project_id , self .id )
597
597
r = self .gitlab ._raw_post (url )
598
- raise_error_from_response (r , GitlabBuildEraseError , 201 )
598
+ raise_error_from_response (r , GitlabJobEraseError , 201 )
599
599
600
600
def keep_artifacts (self , ** kwargs ):
601
601
"""Prevent artifacts from being delete when expiration is set.
@@ -604,14 +604,14 @@ def keep_artifacts(self, **kwargs):
604
604
GitlabConnectionError: If the server cannot be reached.
605
605
GitlabCreateError: If the request failed.
606
606
"""
607
- url = ('/projects/%s/builds /%s/artifacts/keep' %
607
+ url = ('/projects/%s/jobs /%s/artifacts/keep' %
608
608
(self .project_id , self .id ))
609
609
r = self .gitlab ._raw_post (url )
610
610
raise_error_from_response (r , GitlabGetError , 200 )
611
611
612
612
def artifacts (self , streamed = False , action = None , chunk_size = 1024 ,
613
613
** kwargs ):
614
- """Get the build artifacts.
614
+ """Get the job artifacts.
615
615
616
616
Args:
617
617
streamed (bool): If True the data will be processed by chunks of
@@ -628,13 +628,13 @@ def artifacts(self, streamed=False, action=None, chunk_size=1024,
628
628
GitlabConnectionError: If the server cannot be reached.
629
629
GitlabGetError: If the artifacts are not available.
630
630
"""
631
- url = '/projects/%s/builds /%s/artifacts' % (self .project_id , self .id )
631
+ url = '/projects/%s/jobs /%s/artifacts' % (self .project_id , self .id )
632
632
r = self .gitlab ._raw_get (url , streamed = streamed , ** kwargs )
633
633
raise_error_from_response (r , GitlabGetError , 200 )
634
634
return utils .response_content (r , streamed , action , chunk_size )
635
635
636
636
def trace (self , streamed = False , action = None , chunk_size = 1024 , ** kwargs ):
637
- """Get the build trace.
637
+ """Get the job trace.
638
638
639
639
Args:
640
640
streamed (bool): If True the data will be processed by chunks of
@@ -651,14 +651,14 @@ def trace(self, streamed=False, action=None, chunk_size=1024, **kwargs):
651
651
GitlabConnectionError: If the server cannot be reached.
652
652
GitlabGetError: If the trace is not available.
653
653
"""
654
- url = '/projects/%s/builds /%s/trace' % (self .project_id , self .id )
654
+ url = '/projects/%s/jobs /%s/trace' % (self .project_id , self .id )
655
655
r = self .gitlab ._raw_get (url , streamed = streamed , ** kwargs )
656
656
raise_error_from_response (r , GitlabGetError , 200 )
657
657
return utils .response_content (r , streamed , action , chunk_size )
658
658
659
659
660
- class ProjectBuildManager (BaseManager ):
661
- obj_cls = ProjectBuild
660
+ class ProjectJobManager (BaseManager ):
661
+ obj_cls = ProjectJob
662
662
663
663
664
664
class ProjectCommitStatus (GitlabObject ):
@@ -742,22 +742,6 @@ def blob(self, filepath, streamed=False, action=None, chunk_size=1024,
742
742
raise_error_from_response (r , GitlabGetError )
743
743
return utils .response_content (r , streamed , action , chunk_size )
744
744
745
- def builds (self , ** kwargs ):
746
- """List the build for this commit.
747
-
748
- Returns:
749
- list(ProjectBuild): A list of builds.
750
-
751
- Raises:
752
- GitlabConnectionError: If the server cannot be reached.
753
- GitlabListError: If the server fails to perform the request.
754
- """
755
- url = '/projects/%s/repository/commits/%s/builds' % (self .project_id ,
756
- self .id )
757
- return self .gitlab ._raw_list (url , ProjectBuild ,
758
- {'project_id' : self .project_id },
759
- ** kwargs )
760
-
761
745
def cherry_pick (self , branch , ** kwargs ):
762
746
"""Cherry-pick a commit into a branch.
763
747
@@ -1794,7 +1778,7 @@ class Project(GitlabObject):
1794
1778
('boards' , 'ProjectBoardManager' , [('project_id' , 'id' )]),
1795
1779
('board_lists' , 'ProjectBoardListManager' , [('project_id' , 'id' )]),
1796
1780
('branches' , 'ProjectBranchManager' , [('project_id' , 'id' )]),
1797
- ('builds' , 'ProjectBuildManager ' , [('project_id' , 'id' )]),
1781
+ ('builds' , 'ProjectJobManager ' , [('project_id' , 'id' )]),
1798
1782
('commits' , 'ProjectCommitManager' , [('project_id' , 'id' )]),
1799
1783
('deployments' , 'ProjectDeploymentManager' , [('project_id' , 'id' )]),
1800
1784
('environments' , 'ProjectEnvironmentManager' , [('project_id' , 'id' )]),
0 commit comments