-
Notifications
You must be signed in to change notification settings - Fork 832
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for GitLab Branch Source plugin (#1405)
- Loading branch information
1 parent
dfe148f
commit c2ee60a
Showing
4 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...in/docs/examples/javaposse/jobdsl/dsl/helpers/workflow/BranchSourcesContext/gitlab.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
multibranchPipelineJob('example') { | ||
branchSources { | ||
gitlab { | ||
id('23232323') // IMPORTANT: use a constant and unique identifier | ||
serverName('GitLab') | ||
credentialsId('gitlab-ci') | ||
projectOwner('ownerName') | ||
projectPath('ownerName/projectName') | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...re/src/main/groovy/javaposse/jobdsl/dsl/helpers/workflow/GitLabBranchSourceContext.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package javaposse.jobdsl.dsl.helpers.workflow | ||
|
||
import javaposse.jobdsl.dsl.AbstractContext | ||
import javaposse.jobdsl.dsl.JobManagement | ||
|
||
class GitLabBranchSourceContext extends AbstractContext { | ||
String id | ||
String serverName | ||
String credentialsId | ||
String projectOwner | ||
String projectPath | ||
|
||
GitLabBranchSourceContext(JobManagement jobManagement) { | ||
super(jobManagement) | ||
} | ||
|
||
/** | ||
* Specifies a unique ID for this branch source. | ||
*/ | ||
void id(String id) { | ||
this.id = id | ||
} | ||
|
||
/** | ||
* Sets the defined connection to GitLab server. | ||
*/ | ||
void serverName(String serverName) { | ||
this.serverName = serverName | ||
} | ||
|
||
/** | ||
* Sets checkout credentials for authentication with GitLab. | ||
*/ | ||
void credentialsId(String credentialsId) { | ||
this.credentialsId = credentialsId | ||
} | ||
|
||
/** | ||
* Sets the name of the GitLab Group or GitLab User. | ||
*/ | ||
void projectOwner(String projectOwner) { | ||
this.projectOwner = projectOwner | ||
} | ||
|
||
/** | ||
* Sets the full path of the GitLab project. | ||
*/ | ||
void projectPath(String projectPath) { | ||
this.projectPath = projectPath | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters