public class Transformer extends Object
Modifier and Type | Field and Description |
---|---|
protected NodeList |
buildersList |
StringBuffer |
buildSteps |
String |
currentJobName |
protected Document |
dest |
protected Document |
doc |
boolean |
firstJob |
Element |
jdk |
String |
previousLabel |
String |
previousUrl |
StringBuffer |
publishSteps |
StringBuffer |
script |
Constructor and Description |
---|
Transformer(Map requestParams)
Constructor to initialise variables required to process transformation.
|
Modifier and Type | Method and Description |
---|---|
void |
appendToScript(String block)
General method to append script block to main script.
|
void |
appendToScript(String stage,
String block)
General method to append script block with a stage wrap.
|
Element |
getElementByTag(Node node,
String tag)
Gets Element object from Node based on tag name.
|
boolean |
getOnlyBuildTrigger() |
InputStream |
getStream()
Returns the input stream which consists of the entire XML structure of the new pipeline job.
|
void |
performFreeStyleTransformation()
Initialises transformation process of Freestyle project to Pipeline.
|
void |
setOnlyBuildTrigger(boolean value) |
void |
setScmBranch(String scmBranch)
Setter method to set SCM Branch.
|
void |
setScmCredentialsId(String scmCredentialsId)
Setter method to set SCM Credentials Id.
|
void |
setScmType(String scmType)
Setter method to set SCM Type.
|
void |
setScmURL(String scmURL)
Setter method to set SCM URL.
|
protected Document doc
protected Document dest
public Element jdk
protected NodeList buildersList
public boolean firstJob
public StringBuffer script
public StringBuffer buildSteps
public StringBuffer publishSteps
public String currentJobName
public String previousUrl
public String previousLabel
public Transformer(Map requestParams)
requestParams
- Map that contains request parameters.public void performFreeStyleTransformation()
public InputStream getStream()
public void appendToScript(String stage, String block)
stage
- Name of stage to create.block
- Script block to add under stage.public void appendToScript(String block)
block
- Script block to add to main script.public Element getElementByTag(Node node, String tag)
node
- Node object from which element is to be extracted.tag
- Name of tag to extract.public void setScmBranch(String scmBranch)
scmBranch
- SCM Branch to set for committing Jenkinsfile to SCM.public void setScmURL(String scmURL)
scmURL
- SCM URL to set for committing Jenkinsfile to SCM.public void setScmType(String scmType)
scmType
- SCM Type to set for committing Jenkinsfile to SCM.public void setScmCredentialsId(String scmCredentialsId)
scmCredentialsId
- SCM Credentials Id to set for committing Jenkinsfile to SCM.public void setOnlyBuildTrigger(boolean value)
public boolean getOnlyBuildTrigger()
Copyright © 2016–2017. All rights reserved.