Skip to content

Commit b354ff8

Browse files
committed
Add StartJenkinsJob plugin configuration
Introduce a new JSON configuration for the StartJenkinsJob plugin, designed to trigger Jenkins jobs and optionally wait for their completion. The configuration includes metadata, input and output parameters, and detailed descriptions of the plugin's purpose and features. It supports both simple and parameterized jobs, with authentication, polling, and timeout settings. Use cases in RPA and automation testing are outlined, and an example usage scenario is provided. The plugin is categorized as an "Action" type and supports any platform.
1 parent 7eee9ab commit b354ff8

1 file changed

Lines changed: 230 additions & 0 deletions

File tree

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
{
2+
"aliases": [
3+
"TriggerJenkinsJob",
4+
"RunJenkinsBuild"
5+
],
6+
"author": {
7+
"name": "Roei Sabag",
8+
"link": "https://www.linkedin.com/in/roei-sabag-247aa18/"
9+
},
10+
"categories": [
11+
"DevOps"
12+
],
13+
"context": {
14+
"integration": {
15+
"github": {
16+
"document": "https://github.com/g4-api/g4-plugins/blob/main/docs/Actions/StartJenkinsJob.md",
17+
"source": "https://github.com/g4-api/g4-plugins/blob/main/src/G4.Plugins.Common/Actions/StartJenkinsJob.cs"
18+
},
19+
"rag": {
20+
"description": "The StartJenkinsJob plugin triggers a Jenkins job (build or buildWithParameters) and optionally waits for its completion. It supports authentication, parameterized jobs, polling for build status, and outputs job metadata such as status code, duration, and job URL.",
21+
"qa": [
22+
{
23+
"question": "What does the StartJenkinsJob plugin do?",
24+
"answer": "It triggers a Jenkins job, optionally waits for completion, and outputs job status, duration, URL, and response."
25+
},
26+
{
27+
"question": "What are the required parameters?",
28+
"answer": "Url, JobPath, Username, and Token are required. Optional: Field (for parameterized jobs), PollingInterval, Timeout, Wait, RegularExpression, OnElement (JSONPath)."
29+
},
30+
{
31+
"question": "What does the plugin output?",
32+
"answer": "JenkinsJobStatusCode, JenkinsJobDuration, JenkinsJobUrl, JenkinsJobResponse (Base64-encoded regex match from job response)."
33+
},
34+
{
35+
"question": "How does authentication work?",
36+
"answer": "Uses HTTP Basic Auth with the provided Username and Token."
37+
},
38+
{
39+
"question": "What happens if Wait is false?",
40+
"answer": "The plugin returns immediately after triggering the job, only outputting the status code."
41+
},
42+
{
43+
"question": "What is the manifestVersion?",
44+
"answer": "4.0"
45+
}
46+
]
47+
},
48+
"sequentialWorkflow": {
49+
"$type": "Action",
50+
"componentType": "task",
51+
"iconProvider": "jenkins",
52+
"model": "ActionRuleModel"
53+
}
54+
}
55+
},
56+
"description": [
57+
"### Purpose",
58+
"",
59+
"The StartJenkinsJob plugin sends a request to Jenkins to start a specific job and can optionally wait until the build finishes.",
60+
"It supports both simple and parameterized jobs so that different Jenkins job types can be triggered from the same automation.",
61+
"It captures key job details such as status, duration, and URLs so later steps in the workflow can make decisions or log results.",
62+
"",
63+
"### Key Features and Functionality",
64+
"",
65+
"| Feature | Description |",
66+
"|-----------------------|------------------------------------------------------------------------------|",
67+
"| Jenkins Job Trigger | Starts a Jenkins job using the standard build or buildWithParameters API. |",
68+
"| Parameter Support | Detects parameterized jobs and sends the request to the correct endpoint. |",
69+
"| Wait for Completion | Optionally polls Jenkins until the build is finished or a timeout occurs. |",
70+
"| Authentication | Uses HTTP Basic authentication based on Username and Token parameters. |",
71+
"| Polling Configuration | Uses configurable polling interval and timeout values for job monitoring. |",
72+
"| Output Metadata | Stores status code, job duration, and job URL for later workflow steps. |",
73+
"| JSONPath Extraction | Optionally extracts specific fields from the JSON response using JSONPath. |",
74+
"| Regex Post-Processing | Applies a regular expression on the job response and stores the first match. |",
75+
"",
76+
"### Usages in RPA",
77+
"",
78+
"| Use Case | Description |",
79+
"|-------------------------------------|----------------------------------------------------------------------------------------------|",
80+
"| Trigger nightly maintenance jobs | Start scheduled Jenkins jobs that perform system cleanups, backups, or maintenance actions. |",
81+
"| Orchestrate multi-step DevOps flows | Call Jenkins jobs from larger RPA flows that also touch issue trackers and deployment tools. |",
82+
"| Environment preparation jobs | Run Jenkins jobs that prepare test or staging environments before other automated steps run. |",
83+
"| Automated release tasks | Trigger release-related Jenkins jobs as part of a broader RPA-driven release procedure. |",
84+
"| Status-based branching | Use stored job status and URL to decide whether the RPA flow continues or raises an alert. |",
85+
"",
86+
"### Usages in Automation Testing",
87+
"",
88+
"| Use Case | Description |",
89+
"|-------------------------------------------|------------------------------------------------------------------------------------------------------|",
90+
"| Trigger automated test suites | Start Jenkins jobs that run unit, integration, or end-to-end test suites from a central test runner. |",
91+
"| Run smoke tests before deployments | Launch Jenkins smoke-test jobs and wait for completion before allowing deployment steps to proceed. |",
92+
"| Collect timing metrics for test runs | Use stored duration to measure how long Jenkins test jobs take and track performance over time. |",
93+
"| Conditional test result handling | Use JSONPath and regex extraction to read result fields and decide if follow-up actions are needed. |",
94+
"| Integrate CI results into test dashboards | Store job URL and status so external dashboards or reporters can link directly to Jenkins job pages. |"
95+
],
96+
"examples": [
97+
{
98+
"context": {
99+
"annotations": {
100+
"edge_cases": [
101+
"Job not found",
102+
"Authentication failure",
103+
"Timeout waiting for job completion"
104+
],
105+
"expected_result": "Jenkins job is triggered, and status code, duration, URL, and response are output.",
106+
"notes": "Set Wait to true to poll for job completion. Use RegularExpression to extract data from the response.",
107+
"use_case": "trigger_jenkins_job_and_wait",
108+
"version": "1.0"
109+
},
110+
"labels": [
111+
"Jenkins",
112+
"CI/CD",
113+
"DevOps"
114+
]
115+
},
116+
"description": [
117+
"### Trigger Jenkins Job and Wait for Completion",
118+
"",
119+
"Start a Jenkins job, wait for it to finish, and extract job metadata."
120+
],
121+
"rule": {
122+
"$type": "Action",
123+
"argument": "{{$ --Url:https://jenkins.example.com --JobPath:my-job --Username:admin --Token:apitoken --Wait}}",
124+
"pluginName": "StartJenkinsJob"
125+
}
126+
}
127+
],
128+
"key": "StartJenkinsJob",
129+
"manifestVersion": 4,
130+
"outputParameters": [
131+
{
132+
"description": [ "HTTP status code returned by Jenkins when triggering the job" ],
133+
"name": "JenkinsJobStatusCode",
134+
"type": "Int"
135+
},
136+
{
137+
"description": [ "Duration of the Jenkins job in milliseconds (if Wait is true)" ],
138+
"name": "JenkinsJobDuration",
139+
"type": "Int64"
140+
},
141+
{
142+
"description": [ "URL of the triggered Jenkins job (if Wait is true)" ],
143+
"name": "JenkinsJobUrl",
144+
"type": "String"
145+
},
146+
{
147+
"description": [ "Base64-encoded string of the regex match from the job response (if Wait is true and RegularExpression is set)" ],
148+
"name": "JenkinsJobResponse",
149+
"type": "String"
150+
}
151+
],
152+
"parameters": [
153+
{
154+
"description": [ "Base URL of the Jenkins server (e.g., https://jenkins.example.com)" ],
155+
"mandatory": true,
156+
"name": "Url",
157+
"type": "String"
158+
},
159+
{
160+
"name": "JobPath",
161+
"type": "String",
162+
"mandatory": true,
163+
"description": [ "Path of the Jenkins job (e.g., my-job or folder/my-job)" ]
164+
},
165+
{
166+
"name": "Username",
167+
"type": "String",
168+
"mandatory": true,
169+
"description": [ "Jenkins username for authentication" ]
170+
},
171+
{
172+
"name": "Token",
173+
"type": "String",
174+
"mandatory": true,
175+
"description": [ "Jenkins API token or password" ]
176+
},
177+
{
178+
"name": "Field",
179+
"type": "Dictionary|Expression",
180+
"mandatory": false,
181+
"description": [ "Parameters for parameterized jobs (key-value pairs)" ]
182+
},
183+
{
184+
"name": "PollingInterval",
185+
"type": "Int|TimeSpan",
186+
"mandatory": false,
187+
"default": "5000",
188+
"description": [ "Polling interval in milliseconds for job status checks (default: 5000)" ]
189+
},
190+
{
191+
"name": "Timeout",
192+
"type": "Int|TimeSpan",
193+
"mandatory": false,
194+
"default": "600000",
195+
"description": [ "Timeout in milliseconds to wait for job completion (default: 600000)" ]
196+
},
197+
{
198+
"name": "Wait",
199+
"type": "Boolean",
200+
"mandatory": false,
201+
"default": "false",
202+
"description": [ "If true, waits for the Jenkins job to complete before returning" ]
203+
},
204+
{
205+
"name": "RegularExpression",
206+
"type": "String",
207+
"mandatory": false,
208+
"description": [ "Regex pattern to extract data from the job response (optional)" ]
209+
},
210+
{
211+
"name": "OnElement",
212+
"type": "String",
213+
"mandatory": false,
214+
"description": [ "JSONPath expression to extract a portion of the job response (optional)" ]
215+
}
216+
],
217+
"platforms": [
218+
"Any"
219+
],
220+
"pluginType": "Action",
221+
"properties": [],
222+
"protocol": {
223+
"apiDocumentation": "None",
224+
"w3c": "None"
225+
},
226+
"summary": [
227+
"StartJenkinsJob triggers a Jenkins job, optionally waits for completion, and outputs job status, duration, URL, and extracted response data.",
228+
"Supports authentication, parameterized jobs, polling, and output extraction via JSONPath and Regex."
229+
]
230+
}

0 commit comments

Comments
 (0)