public class SCMUtil extends Object
Constructor and Description |
---|
SCMUtil() |
Modifier and Type | Method and Description |
---|---|
void |
pushJenkinsfile(String script,
String url,
String branchName,
String credentialsId,
String commitMessage,
String scmType)
Public method to create Jenkinsfile from script and push to given SCM repo.
|
static void |
writeJenkinsfile(File workSpace,
String script)
Writes script to Jenkinsfile and adds to workspace.
|
public void pushJenkinsfile(String script, String url, String branchName, String credentialsId, String commitMessage, String scmType)
script
- Groovy script to be written in Jenkinsfileurl
- URL of SCM repository where Jenkinsfile is to be pushed.branchName
- Branch of SCM where Jenkinsfile is to be pushed.credentialsId
- Credentials to checkout, commit and push to SCM.commitMessage
- Commit message to be included in commit when pushing Jenkinsfile.scmType
- Type of SCM.public static void writeJenkinsfile(File workSpace, String script)
workSpace
- Workspace in which the Jenkinsfile will be added.script
- Groovy script to be written in Jenkinsfile.Copyright © 2016–2017. All rights reserved.