public static class BuildBambooStep.Execution extends org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution<Void>
SynchronousNonBlockingStepExecution, so as not to block the main thread.
This will still block an executor on an agent, and should be run with agent set to "none" in your pipeline
script.| Constructor and Description |
|---|
Execution(BuildBambooStep step,
org.jenkinsci.plugins.workflow.steps.StepContext context,
HttpClientFactory httpClientFactory)
Constructor for the execution, invoked by
BuildBambooStep.start(org.jenkinsci.plugins.workflow.steps.StepContext) |
| Modifier and Type | Method and Description |
|---|---|
String |
get(String url,
String username,
String password)
GET data from the server.
|
int |
getBuildNumber(String text)
Get the build number after we start the job.
|
Map<String,String> |
getBuildStatus(String text)
Get the job state and lifecycle state of a Bamboo job.
|
HttpClientFactory |
getHttpClientFactory()
HttpClientFactory getter
|
PrintStream |
getLogger()
logger getter
|
BuildBambooStep |
getStep()
Step getter
|
boolean |
getStopExecution()
stopExecution getter.
|
String |
post(String url,
String username,
String password,
Map<String,Object> params)
POST data to the server.
|
Void |
run()
Perform the actual work.
|
void |
setLogger(PrintStream logger)
logger setter
|
void |
stop(Throwable throwable)
Handles cleanup.
|
getStatus, onResume, startpublic Execution(BuildBambooStep step, @Nonnull org.jenkinsci.plugins.workflow.steps.StepContext context, HttpClientFactory httpClientFactory) throws InterruptedException, IOException
BuildBambooStep.start(org.jenkinsci.plugins.workflow.steps.StepContext)step - BuildBambooStep object. "this" should be passed in BuildBambooStep.start(org.jenkinsci.plugins.workflow.steps.StepContext)context - StepContexthttpClientFactory - Factory for creating HTTP clients.InterruptedException - Throws InterruptedExceptionIOException - Throws IOExceptionpublic BuildBambooStep getStep()
public boolean getStopExecution()
stop(java.lang.Throwable) to exit the polling loop.public HttpClientFactory getHttpClientFactory()
public PrintStream getLogger()
public void setLogger(PrintStream logger)
logger - A PrintStream to log to.public String post(String url, String username, String password, Map<String,Object> params)
url - Bamboo target server URL. Example: http://bamboo-server.example.orgusername - Bamboo API usernamepassword - Bamboo API passwordparams - Currently unusedpublic String get(String url, String username, String password)
url - Bamboo target server URL. Example: http://bamboo-server.example.orgusername - Bamboo API usernamepassword - Bamboo API passwordpublic int getBuildNumber(String text)
text - POST data returned from Bamboo server after initiating build.public Map<String,String> getBuildStatus(String text)
text - JSON formatted text, returned by Bamboo.public Void run() throws Exception
public void stop(@Nonnull Throwable throwable) throws Exception
stopExecution
to exit the poll loop in run()Copyright © 2016–2017. All rights reserved.