File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ public class ProjectsResource {
25
25
@ ConfigProperty (name = "residenciesParentRepositoryId" , defaultValue = "6284" )
26
26
protected Integer residenciesParentRepositoryId ;
27
27
28
+ @ ConfigProperty (name = "deployKey" )
29
+ protected Integer deployKey ;
30
+
28
31
@ GET
29
32
public String listAllProjects () {
30
33
return gitLabService .getProjects ().readEntity (String .class );
@@ -41,6 +44,8 @@ public GitLabCreateProjectResponse createNewProject(CreateProjectRequest request
41
44
GitLabCreateProjectRequest gitLabRequest = new GitLabCreateProjectRequest ();
42
45
gitLabRequest .name = request .projectName ;
43
46
gitLabRequest .namespace_id = residenciesRepoId ;
44
- return gitLabService .createNewProject (gitLabRequest );
47
+ GitLabCreateProjectResponse gitLabProject = gitLabService .createNewProject (gitLabRequest );
48
+ gitLabService .enableDeployKey (gitLabProject .id , deployKey );
49
+ return gitLabProject ;
45
50
}
46
51
}
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ public interface GitLabService {
39
39
@ Produces ("application/json" )
40
40
GitLabCreateProjectResponse createNewProject (GitLabCreateProjectRequest request );
41
41
42
+ // reference: https://docs.gitlab.com/ce/api/deploy_keys.html#enable-a-deploy-key
43
+ @ POST
44
+ @ Path ("/projects/{id}/deploy_keys/{deploy_key}/enable" )
45
+ @ Produces ("application/json" )
46
+ Response enableDeployKey (@ PathParam ("id" ) @ Encoded Integer projectId , @ PathParam ("deploy_key" ) @ Encoded Integer deployKey );
47
+
42
48
// reference: https://docs.gitlab.com/ee/api/repository_files.html#create-new-file-in-repository
43
49
@ POST
44
50
@ Path ("/projects/{id}/repository/files/{file_path}" )
Original file line number Diff line number Diff line change @@ -34,5 +34,5 @@ file_branch=master
34
34
templateRepositoryId =${TEMPLATE_REPOSITORY_ID:1}
35
35
residenciesParentRepositoryId =${RESIDENCIES_PARENT_REPOSITORIES_ID:2}
36
36
gitlab.api/mp-rest/url =${GITLAB_API_URL:https://acmegit.com}
37
-
37
+ deployKey = ${DEPLOY_KEY:0}
38
38
You can’t perform that action at this time.
0 commit comments