Namespace | http://www.mulesoft.org/schema/mule/jenkins |
---|---|
Schema Location | http://www.mulesoft.org/schema/mule/jenkins/current/mule-jenkins.xsd (View Schema) |
Schema Version | 1.0 |
Minimum Mule Version | 3.2 |
Provides the ability to interact with Jenkins API REST.
Configuration | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Configure an instance of this module
|
Message Processors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Perform a job build
| |||||||||||
Perform a parametrized job build using a map
| |||||||||||
Create new job using another job as a copy
| |||||||||||
Create new job using basic configuration
| |||||||||||
Delete job
| |||||||||||
Disable job
| |||||||||||
Enable job
| |||||||||||
Retrieve jenkins server node information
| |||||||||||
Get job build info
| |||||||||||
Get job build console log text
| |||||||||||
Retrieves Jenkins job information using job name to find it
| |||||||||||
Retrieves Jenkins Queue information, is the current build activity
|
To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jenkins="http://www.mulesoft.org/schema/mule/jenkins" xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/jenkins http://www.mulesoft.org/schema/mule/jenkins/current/mule-jenkins.xsd"> <!-- here goes your flows and configuration elements --> </mule>
This connector offers automatic connection management via the use of a connection pool. The pool will act a storage mechanism for all the connections that are in-use by the user of this connector.
Prior to execution of a processor, the connector will attempt to lookup an already established connection and if one doesn't exists it will create one. That lookup mechanism is done in the connection pool via the use of connection variables declared as keys.
The user of the connector can configure the pool by adding a connection-pooling-profile
to the connector configuration like this:
<jenkins:connection-pooling-profile maxActive="10" maxIdle="10" exhaustedAction="WHEN_EXHAUSTED_GROW" maxWait="120" minEvictionMillis="60000" evictionCheckIntervalMillis="30000"/>
The following is a list of connection attributes, each connection attribute can be configured at the config element level or they can also be added to each processor. If they are used at the processor level they get the benefit of full expression resolution.
Connection Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
Optional. Specify which configuration to use. | |||||||||||
A String identification for the connection | String | */* | UTF-8 | ||||||||
A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Reconnection Strategies specify how a connector behaves when its connection fails. You can control how Mule attempts to reconnect by specifying a number of criteria:
With a reconnection strategy, you can better control the behavior of a failed connection, by configuring it, for example, to re-attempt the connection only once every 15 minutes, and to give up after 30 attempts. You can also send an automatic notification to your IT administrator whenever this reconnection strategy goes into effect. You can even define a strategy that attempts to reconnect only during business hours. Such a setting can prove useful if your server is frequently shut down for nightly maintenance.
A reconnection strategy that allows the user to configure how many times a reconnection should be attempted and how long to wait between attempts.
<jenkins:config> <reconnect count="5" frequency="1000"/> </jenkins:config>
Reconnect Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Name | Default Value | Description | |||||||||
Optional. How often (in ms) to reconnect | |||||||||||
Optional. How many reconnection attempts to make |
For more information about reconnection strategies in Mule, or even how to write your own custom reconnection strategy please check this section.
Perform a job build
<jenkins:build jobName="ion-console" />
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Optional. Specify which configuration to use. | |||||||||||
Name of the job to retrieve info | String | */* | UTF-8 | ||||||||
Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
Optional. A String identification for the connection | String | */* | UTF-8 | ||||||||
Optional. A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Payload Class | Description |
---|---|
JenkinsDeploymentException | exception |
Perform a parametrized job build using a map
<jenkins:build-with-parameters jobName="company-deploy" > <jenkins:params> <jenkins:param key="version">18</jenkins:param> <jenkins:param key="build">233</jenkins:param> </jenkins:params> </jenkins:build-with-parameters >
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Optional. Specify which configuration to use. | |||||||||||
Name of the job to retrieve info | String | */* | UTF-8 | ||||||||
Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
Optional. A String identification for the connection | String | */* | UTF-8 | ||||||||
Optional. A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Name | Default Value | Description | Java Type |
---|---|---|---|
Build parameters map | Map<String, String> |
Payload Class | Description |
---|---|
JenkinsDeploymentException | exception |
Create new job using another job as a copy
<jenkins:copy-job newJobName="JobName" fromJobName="OtherJobName"/>
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Optional. Specify which configuration to use. | |||||||||||
Name of the job to create | String | */* | UTF-8 | ||||||||
Name of the job to copy | String | */* | UTF-8 | ||||||||
Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
Optional. A String identification for the connection | String | */* | UTF-8 | ||||||||
Optional. A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Return Type | Description |
---|---|
JobInfo | The created Jenkins job info if exits, an empty object if creation failed |
Payload Class | Description |
---|---|
JenkinsConnectorException | exception |
Create new job using basic configuration
<jenkins:create-job jobName="newJobName"/>
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Optional. Specify which configuration to use. | |||||||||||
Name of the job to create | String | */* | UTF-8 | ||||||||
Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
Optional. A String identification for the connection | String | */* | UTF-8 | ||||||||
Optional. A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Return Type | Description |
---|---|
JobInfo | The created Jenkins job info if exits, an empty object if creation failed |
Payload Class | Description |
---|---|
JenkinsConnectorException | exception |
Delete job
<jenkins:delete-job jobName="nJobName"/>
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Optional. Specify which configuration to use. | |||||||||||
Name of the job to delete | String | */* | UTF-8 | ||||||||
Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
Optional. A String identification for the connection | String | */* | UTF-8 | ||||||||
Optional. A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Payload Class | Description |
---|---|
JenkinsConnectorException | exception |
Disable job
<jenkins:disable-job jobName="JobName"/>
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Optional. Specify which configuration to use. | |||||||||||
Name of the job to disable | String | */* | UTF-8 | ||||||||
Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
Optional. A String identification for the connection | String | */* | UTF-8 | ||||||||
Optional. A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Payload Class | Description |
---|---|
JenkinsConnectorException | exception |
Enable job
<jenkins:enable-job jobName="JobName"/>
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Optional. Specify which configuration to use. | |||||||||||
Name of the job to enable | String | */* | UTF-8 | ||||||||
Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
Optional. A String identification for the connection | String | */* | UTF-8 | ||||||||
Optional. A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Payload Class | Description |
---|---|
JenkinsConnectorException | exception |
Retrieve jenkins server node information
<jenkins:get-jenkins-node-info />
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Optional. Specify which configuration to use. | |||||||||||
Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
Optional. A String identification for the connection | String | */* | UTF-8 | ||||||||
Optional. A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Return Type | Description |
---|---|
JenkinsInfo | Jenkins node info |
Payload Class | Description |
---|---|
JenkinsConnectorException | exception |
Get job build info
<jenkins:get-job-build-info jobName="JobName" buildNumber="1"/>
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Optional. Specify which configuration to use. | |||||||||||
Job name | String | */* | UTF-8 | ||||||||
Build number | int | */* | |||||||||
Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
Optional. A String identification for the connection | String | */* | UTF-8 | ||||||||
Optional. A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Return Type | Description |
---|---|
BuildInfo | Build info representation object |
Payload Class | Description |
---|---|
JenkinsConnectorException | exception |
Get job build console log text
<jenkins:get-job-build-log jobName="JobName" buildNumber="1"/>
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Optional. Specify which configuration to use. | |||||||||||
Job name | String | */* | UTF-8 | ||||||||
Build number | String | */* | UTF-8 | ||||||||
Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
Optional. A String identification for the connection | String | */* | UTF-8 | ||||||||
Optional. A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Return Type | Description |
---|---|
String | String with the log output for the requested Job |
Payload Class | Description |
---|---|
JenkinsConnectorException | exception |
Retrieves Jenkins job information using job name to find it
<jenkins:get-job-info jobName="jobname" />
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Optional. Specify which configuration to use. | |||||||||||
Name of the job to retrieve info | String | */* | UTF-8 | ||||||||
Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
Optional. A String identification for the connection | String | */* | UTF-8 | ||||||||
Optional. A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Return Type | Description |
---|---|
JobInfo | Jenkins job info |
Payload Class | Description |
---|---|
JenkinsConnectorException | exception |
Retrieves Jenkins Queue information, is the current build activity
<jenkins:get-queue-info />
Name | Default Value | Description | Java Type | MIME Type | Encoding | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Optional. Specify which configuration to use. | |||||||||||
Connection Parameters This are only required if you didn't specified them at the configuration element. They are also useful for overriding the values of the configurations or even if you need to extract them from the Mule message since they support expression evaluation. | |||||||||||
Optional. A String identification for the connection | String | */* | UTF-8 | ||||||||
Optional. A Jenkins server URL | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 | ||||||||
Optional. Optional | String | */* | UTF-8 |
Return Type | Description |
---|---|
JenkinsQueueInfo | Jenkins queue job info |
Payload Class | Description |
---|---|
JenkinsConnectorException | exception |