### startET Source: https://www.jenkins.io/doc/pipeline/steps/ecutest Configures and starts a preconfigured ecu.test installation. ```APIDOC ## startET ### Description Configures and starts a preconfigured ecu.test installation. ### Method Signatures ```groovy startET(String toolName) : void startET(String toolName, String workspaceDir, String settingsDir, int timeout, boolean debugMode, boolean keepInstance, boolean updateUserLibs) : void ETInstance.start() : void ETInstance.start(String workspaceDir, String settingsDir, int timeout, boolean debugMode, boolean keepInstance, boolean updateUserLibs) : void ETInstance.start(Map settings) : void ``` ### Parameters * `toolName` (String) - The name of the ECU-TEST tool configuration. * `installation` (ETInstallation) - The ECU-TEST installation to use. * `workspaceDir` (String, optional) - The directory for the ECU-TEST workspace. * `settingsDir` (String, optional) - The directory for ECU-TEST settings. * `timeout` (int, optional) - The timeout in seconds for starting the instance. * `debugMode` (boolean, optional) - Whether to start in debug mode. * `keepInstance` (boolean, optional) - Whether to keep the ECU-TEST instance after the job finishes. * `updateUserLibs` (boolean, optional) - Whether to update user libraries. ### Examples ```groovy startET('ecu.test') def instance = ET.installation('ecu.test') startET installation: instance.installation, workspaceDir: 'C:\Data' def instance = ET.newInstallation('ecu.test', 'C:\Program Files\ECU-TEST 8.0') instance.start() def instance = ET.newInstallation toolName: 'ecu.test', installPath: 'C:\Program Files\ECU-TEST 8.0' instance.start workspaceDir: 'C:\Data', settingsDir: 'C:\Data', timeout: 120, debugMode: true, keepInstance: false, updateUserLibs: true ``` ``` -------------------------------- ### Custom Dockerfile Example Source: https://www.jenkins.io/doc/book/pipeline/docker Example Dockerfile that installs Node.js and subversion, to be used with `agent { dockerfile true }`. ```dockerfile FROM node:24.18.0-alpine3.24 RUN apk add -U subversion ``` -------------------------------- ### Example: Publish ECU-TEST Trace Analysis Source: https://www.jenkins.io/doc/pipeline/steps/ecutest Examples demonstrating how to publish trace analysis reports. The first example uses a simple tool name, while subsequent examples show more detailed configuration using installation instances. ```groovy publishTraceAnalysis('ecu.test') ``` ```groovy def instance = ET.installation('ecu.test') publishTraceAnalysis installation: instance.installation, mergeReports: true, createReportDir: false ``` ```groovy def instance = ET.newInstallation('ecu.test', 'C:\\Program Files\\ECU-TEST 8.0') instance.publishTraceAnalysis() ``` ```groovy def instance = ET.newInstallation toolName: 'ecu.test', installPath: 'C:\\Program Files\\ECU-TEST 8.0' instance.publishTraceAnalysis mergeReports: true, createReportDir: false, timeout: 120, allowMissing: true, runOnFailed: true, archiving: true, keepAll: true ``` -------------------------------- ### Git Reference Repository Setup Source: https://www.jenkins.io/doc/pipeline/steps/workflow-multibranch This example shows how to initialize a bare Git repository and add remote URLs for subprojects, followed by fetching all branches. This is used to prepare a reference folder for Git clone operations. ```bash git init --bare git remote add SubProject1 https://gitrepo.com/subproject1 git remote add SubProject2 https://gitrepo.com/subproject2 git fetch --all ``` -------------------------------- ### Start Local Jenkins Instance Source: https://www.jenkins.io/doc/book/managing/script-console Use this command to start a local copy of Jenkins for testing Script Console examples. Ensure JENKINS_HOME is set to a local directory. Use CTRL+C to stop the instance. Not recommended for production environments. ```shell export JENKINS_HOME="./my_jenkins_home" java -jar jenkins.war ``` -------------------------------- ### Start ECU-TEST Instance Source: https://www.jenkins.io/doc/pipeline/steps/ecutest Configures and starts a preconfigured ECU-TEST installation. Use this to launch ECU-TEST with specific workspace, settings, and operational parameters. ```groovy startET(String toolName) : void ``` ```groovy startET(String toolName, String workspaceDir, String settingsDir, int timeout, boolean debugMode, boolean keepInstance, boolean updateUserLibs) : void ``` ```groovy ETInstance.start() : void ``` ```groovy ETInstance.start(String workspaceDir, String settingsDir, int timeout, boolean debugMode, boolean keepInstance, boolean updateUserLibs) : void ``` ```groovy ETInstance.start(Map settings) : void ``` ```groovy startET('ecu.test') ``` ```groovy def instance = ET.installation('ecu.test') startET installation: instance.installation, workspaceDir: 'C:\\Data' ``` ```groovy def instance = ET.newInstallation('ecu.test', 'C:\\Program Files\\ECU-TEST 8.0') instance.start() ``` ```groovy def instance = ET.newInstallation toolName: 'ecu.test', installPath: C:\\Program Files\\ECU-TEST 8.0' instance.start workspaceDir: 'C:\\Data', settingsDir: 'C:\\Data', timeout: 120, debugMode: true, keepInstance: false, updateUserLibs: true ``` -------------------------------- ### Start Jenkins Controller with Docker Compose Source: https://www.jenkins.io/doc/tutorials/build-a-cpp-app-with-jenkins Start the Jenkins controller using Docker Compose for the C++ application tutorial. Ensure Docker and Docker Compose are installed and that you are in the quickstart-tutorials directory. ```bash docker compose --profile cpp up -d ``` -------------------------------- ### getATXServer Source: https://www.jenkins.io/doc/pipeline/steps/ecutest Gets a test.guide server instance by name which must be present in the test.guide installations. Existing settings can be discovered and overridden afterwards. ```APIDOC ## getATXServer ### Description Gets a test.guide server instance by name which must be present in the test.guide installations. Existing settings can be discovered and overridden afterwards. For providing secrets like upload authentication key or proxy settings utilize credentials binding and pass as masked environment variables. ### Method Signatures 1. `ATX.server(String atxName) : ATXServer` 2. `ATXServer.getSetting(String settingName) : ATXSetting` 3. `ATXServer.getSettings() : Map` 4. `ATXServer.overrideSetting(String settingName, Object settingValue) : void` 5. `ATXServer.overrideSettings(Map settings) : void` ### Parameters * `atxName` (String) - The name of the test.guide server. * `settingName` (String) - The name of the setting to retrieve or override. * `settingValue` (Object) - The value to override the setting with. * `settings` (Map) - A map of settings to override. ### Examples ```groovy ATX.server('test.guide') ``` ```groovy ATX.server atxName: 'test.guide' ``` ```groovy def server ATX.server atxName: 'test.guide' server.getSetting('serverURL') server.getSettings() server.overrideSetting('uploadToServer', true) server.overrideSettings([serverURL: 'localhost', useHttpsConnection: true]) ``` ``` -------------------------------- ### startTS Source: https://www.jenkins.io/doc/pipeline/steps/ecutest Configures and starts the Tool-Server. This can be done with various overloads to specify tool name, installation path, and server settings. ```APIDOC ## startTS ### Description Configures and starts the Tool-Server. ### Signatures - `startTS(String toolName) : void` - `startTS(String toolName, String toolLibsIniPath, int tcpPort, int timeout, boolean keepInstance) : void` - `ETInstance.startTS() : void` - `ETInstance.startTS(String toolLibsIniPath, int tcpPort, int timeout, boolean keepInstance) : void` - `ETInstance.startTS(Map settings) : void` ### Parameters - `toolName` (String) - The name of the tool. - `toolLibsIniPath` (String) - Path to the ToolLibs.ini file. - `tcpPort` (int) - The TCP port for the server. - `timeout` (int) - The timeout in seconds. - `keepInstance` (boolean) - Whether to keep the instance running. - `settings` (Map) - A map of settings for the Tool-Server. ### Examples ```groovy startTS('ecu.test') ``` ```groovy def instance = ET.installation('ecu.test') startTS installation: instance.installation ``` ```groovy def instance = ET.newInstallation('ecu.test', 'C:\Program Files\ECU-TEST 8.0') instance.startTS() ``` ```groovy def instance = ET.newInstallation toolName: 'ecu.test', installPath: 'C:\Program Files\ECU-TEST 8.0' instance.startTS toolLibsIniPath: 'C:\ToolLibs.ini', tcpPort: 5017, timeout: 60, keepInstance: false ``` ``` -------------------------------- ### Get ecu.test Installation Source: https://www.jenkins.io/doc/pipeline/steps/ecutest Obtains an ecu.test installation instance by its configured name in Jenkins global tool configuration. ```groovy ET.installation('ecu.test') ``` ```groovy ET.installation toolName: 'ecu.test' ``` -------------------------------- ### Prepare and Push MyApplication Repository Source: https://www.jenkins.io/doc/tutorials/build-a-labview-app Navigate to the myApplication directory, add, commit, and push all files. ```bash cd <> git add . git commit -m "Added files" git push origin master ``` -------------------------------- ### alaudaStartBuild Source: https://www.jenkins.io/doc/pipeline/steps/alauda-pipeline Starts a build in Alauda. ```APIDOC ## alaudaStartBuild ### Description Starts a build in Alauda. ### Parameters #### Path Parameters - **buildConfigName** (String) - Optional - The name of the build configuration. - **async** (boolean) - Optional - Whether to start the build asynchronously. - **branch** (String) - Optional - The branch for the build. - **commitID** (String) - Optional - The commit ID for the build. - **spaceName** (String) - Optional - The name of the space. ``` -------------------------------- ### Setup Node.js Environment Source: https://www.jenkins.io/doc/tutorials/using-jenkinsfile-runner-github-action-to-build-jenkins-pipeline Configure the Node.js environment for your project using 'actions/setup-node@v3'. Specify the desired Node.js version. ```yaml - uses: actions/setup-node@v3 with: node-version: 18 ``` -------------------------------- ### Create new ATX server with archive setting Source: https://www.jenkins.io/doc/pipeline/steps/ecutest This example shows how to create a new ATX server and disable archiving. ```groovy ATX.newServer atxName: 'test.guide', toolName: 'ecu.test', enableArchive: false ``` -------------------------------- ### Drush Makefile Example Source: https://www.jenkins.io/doc/pipeline/steps/jira Example content for a Drush Makefile to generate a specific Drupal version. Ensure your Drush installation supports YAML Makefiles. ```makefile api=2 core=7.x projects[drupal][version]=7.38 ``` -------------------------------- ### Git Reference Repository Setup Source: https://www.jenkins.io/doc/pipeline/steps/git-push Prepare a reference folder for Git clone operations by initializing a bare repository and fetching all remotes. ```git git init --bare git remote add SubProject1 https://gitrepo.com/subproject1 git remote add SubProject2 https://gitrepo.com/subproject2 git fetch --all ``` -------------------------------- ### Groovy Script for Jenkins Controller Setup Source: https://www.jenkins.io/doc/tutorials/using-jenkinsfile-runner-github-action-to-build-jenkins-pipeline Add a simple Groovy script to the init.d directory to execute setup logic when the Jenkins controller starts. ```groovy println 'Hello Groovy Hooks!' ``` -------------------------------- ### Java Code Example Source: https://www.jenkins.io/doc/developer/handling-requests/json Example of handling HTTP GET requests and returning JSON responses in Jenkins. ```java /* (1) */ import static java.util.Objects.requireNonNull; import edu.umd.cs.findbugs.annotations.CheckForNull; import hudson.Extension; import hudson.model.RootAction; import net.sf.json.JSONObject; import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.WebMethod; import org.kohsuke.stapler.json.JsonBody; import org.kohsuke.stapler.json.JsonHttpResponse; import org.kohsuke.stapler.verb.GET; import org.kohsuke.stapler.verb.POST; @Extension /* (2) */ public class JsonAPI implements RootAction /* (3) */ { @CheckForNull @Override public String getIconFileName() { return null; /* (4) */ } @CheckForNull @Override public String getDisplayName() { return null; /* (5) */ } @Override public String getUrlName() { return "custom-api"; /* (6) */ } @GET @WebMethod(name = "get-example")/* (7) */ public /* (8) */ JsonHttpResponse getExample() { JSONObject response = JSONObject.fromObject(new MyJsonObject("I am Jenkins")); return new JsonHttpResponse(response, 200); /* (9) */ } @GET @WebMethod(name = "get-example-param") public JsonHttpResponse getWithParameters( @QueryParameter(required = true) String paramValue /* (10) */) { requireNonNull(paramValue); MyJsonObject myJsonObject = new MyJsonObject("I am Jenkins " + paramValue); JSONObject response = JSONObject.fromObject(myJsonObject); return new JsonHttpResponse(response, 200); } @GET @WebMethod(name = "get-error500") public JsonHttpResponse getError500() { /* (11) */ MyJsonObject myJsonObject = new MyJsonObject("You got an error 500"); JSONObject jsonResponse = JSONObject.fromObject(myJsonObject); JsonHttpResponse error500 = new JsonHttpResponse(jsonResponse, 500); throw error500; } } ``` -------------------------------- ### Configure ATX server settings via overrideSetting Source: https://www.jenkins.io/doc/pipeline/steps/ecutest Demonstrates how to configure specific server settings like URL, port, and context path after creating a server instance. ```groovy def server = ATX.newServer atxName: 'test.guide', toolName: 'ecu.test' server.overrideSetting('serverURL', '127.0.0.1') server.overrideSetting('serverPort', '8086') server.overrideSetting('serverContextPath', 'context') server.overrideSetting('useHttpsConnection', true) server.overrideSetting('uploadToServer', true) ``` -------------------------------- ### Disk Allocation and Build Example Source: https://www.jenkins.io/doc/pipeline/examples Demonstrates allocating a disk from a pool and performing code checkout and build on a 'linux' node, followed by testing on a 'test' node with conditional cleanup. ```groovy // allocate a Disk from the Disk Pool defined in the Jenkins global config def extWorkspace = exwsAllocate 'diskpool1' // on a node labeled 'linux', perform code checkout and build the project node('linux') { // compute complete workspace path, from current node to the allocated disk exws(extWorkspace) { // checkout code from repo checkout scm // build project, but skip running tests sh 'mvn clean install -DskipTests' } } // on a different node, labeled 'test', perform testing using the same workspace as previously // at the end, if the build have passed, delete the workspace node('test') { // compute complete workspace path, from current node to the allocated disk exws(extWorkspace) { try { // run tests in the same workspace that the project was built sh 'mvn test' } catch (e) { // if any exception occurs, mark the build as failed currentBuild.result = 'FAILURE' throw e } finally { // perform workspace cleanup only if the build have passed // if the build has failed, the workspace will be kept cleanWs cleanWhenFailure: false } } } ``` -------------------------------- ### Get Build Cause Source: https://www.jenkins.io/doc/pipeline/examples Shows how to get the Cause(s) of a Pipeline build from within the Pipeline script, including accessing specific cause types like the user who initiated the build. ```groovy // As of Pipeline Supporting APIs v2.22, there is a whitelisted API to access // build causes as JSON that is available inside of the Pipeline Sandbox. // Get all Causes for the current build def causes = currentBuild.getBuildCauses() // Get a specific Cause type (in this case the user who kicked off the build), // if present. def specificCause = currentBuild.getBuildCauses('hudson.model.Cause$UserIdCause') // The JSON data is created by calling methods annotated with `@Exported` for // each Cause type. See the Javadoc for specific Cause types to check exactly // what data will be available. // For example, for a build triggered manually by a specific user, the resulting // JSON would be something like the following: // // [ // { // "_class": "hudson.model.Cause$UserIdCause", // "shortDescription": "Started by user anonymous", // "userId": "tester", // "userName": "anonymous" // } // ] // cf. https://javadoc.jenkins-ci.org/hudson/model/Cause.UserIdCause.html ``` -------------------------------- ### getETInstallation Source: https://www.jenkins.io/doc/pipeline/steps/ecutest Gets an ecu.test installation instance by name which must be present in Jenkins global tool configuration. ```APIDOC ## getETInstallation ### Description Gets an ecu.test installation instance by name which must be present in Jenkins global tool configuration. ### Method Signatures 1. `ET.installation(String toolName) : ETInstance` 2. `ET.installation(Map installArgs) : ETInstance` ### Parameters * `toolName` (String) - The name of the ecu.test installation. * `installArgs` (Map) - A map of installation arguments. ### Examples ```groovy ET.installation('ecu.test') ``` ```groovy ET.installation toolName: 'ecu.test' ``` ``` -------------------------------- ### Set up CD Workflow Source: https://www.jenkins.io/doc/developer/publishing/releasing-cd Create the CD workflow file by copying the template. Ensure the `.github/workflows` directory exists. ```shell mkdir -p .github/workflows curl --silent --show-error --location --output .github/workflows/cd.yaml https://raw.githubusercontent.com/jenkinsci/.github/master/workflow-templates/cd.yaml git add .github/workflows/cd.yaml ``` -------------------------------- ### Java HttpClient Example for Preemptive Authentication Source: https://www.jenkins.io/doc/book/system-administration/authenticating-scripted-clients This Java example demonstrates how to use httpclient 4.3.x to issue authentication preemptively when interacting with Jenkins. It sets up credentials, an authentication cache, and executes an HTTP GET request. ```java import java.io.IOException; import java.net.URI; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; import org.apache.http.auth.AuthScope; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.AuthCache; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.CredentialsProvider; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.protocol.HttpClientContext; import org.apache.http.impl.auth.BasicScheme; import org.apache.http.impl.client.BasicAuthCache; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; public class JenkinsScraper { public String scrape(String urlString, String username, String password) throws ClientProtocolException, IOException { URI uri = URI.create(urlString); HttpHost host = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme()); CredentialsProvider credsProvider = new BasicCredentialsProvider(); credsProvider.setCredentials(new AuthScope(uri.getHost(), uri.getPort()), new UsernamePasswordCredentials(username, password)); // Create AuthCache instance AuthCache authCache = new BasicAuthCache(); // Generate BASIC scheme object and add it to the local auth cache BasicScheme basicAuth = new BasicScheme(); authCache.put(host, basicAuth); CloseableHttpClient httpClient = HttpClients.custom().setDefaultCredentialsProvider(credsProvider).build(); HttpGet httpGet = new HttpGet(uri); // Add AuthCache to the execution context HttpClientContext localContext = HttpClientContext.create(); localContext.setAuthCache(authCache); HttpResponse response = httpClient.execute(host, httpGet, localContext); return EntityUtils.toString(response.getEntity()); } } ``` -------------------------------- ### Start Tool-Server with startTS Source: https://www.jenkins.io/doc/pipeline/steps/ecutest Configure and start the Tool-Server. Use this when you need to manage the Tool-Server process within your pipeline. ```groovy startTS('ecu.test') ``` ```groovy def instance = ET.installation('ecu.test') startTS installation: instance.installation ``` ```groovy def instance = ET.newInstallation('ecu.test', 'C:\\Program Files\\ECU-TEST 8.0') instance.startTS() ``` ```groovy def instance = ET.newInstallation toolName: 'ecu.test', installPath: C:\\Program Files\\ECU-TEST 8.0' instance.startTS toolLibsIniPath: C:\\ToolLibs.ini, tcpPort: 5017, timeout: 60, keepInstance: false ``` -------------------------------- ### Create Dockerfile for Jenkins with Blue Ocean and Docker Plugins Source: https://www.jenkins.io/doc/tutorials/create-a-pipeline-in-blue-ocean This Dockerfile defines a custom Jenkins image. It starts from an official Jenkins image, installs Docker CLI, and then installs the Blue Ocean and Docker Pipeline plugins. ```dockerfile FROM jenkins/jenkins:2.555.3-jdk21 USER root RUN apt-get update && apt-get install -y lsb-release ca-certificates curl && \ install -m 0755 -d /etc/apt/keyrings && \ curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc && \ chmod a+r /etc/apt/keyrings/docker.asc && \ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \ https://download.docker.com/linux/debian $(. /etc/os-release && echo \"$VERSION_CODENAME\") stable" \ | tee /etc/apt/sources.list.d/docker.list > /dev/null && \ apt-get update && apt-get install -y docker-ce-cli && \ apt-get clean && rm -rf /var/lib/apt/lists/* USER jenkins RUN jenkins-plugin-cli --plugins "blueocean:1.27.25 docker-workflow:634.vedc7242b_eda_7 json-path-api" ``` -------------------------------- ### Property File Example Source: https://www.jenkins.io/doc/pipeline/steps/hubot-steps Illustrates a property file with key-value pairs where values can reference other properties using `${propertyName}` syntax. This allows for dynamic definition of choices. ```text prop1=a,b,c,d,e prop2=${prop1},f,g,h ``` -------------------------------- ### Example of test with JenkinsRule for GET requests Source: https://www.jenkins.io/doc/developer/handling-requests/json This Java code demonstrates how to test JSON GET requests using JenkinsRule, including handling different status codes and authentication. ```java import static org.hamcrest.MatcherAssert.assertThat; import jenkins.model.Jenkins; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.JenkinsRule.JSONWebResponse; import org.jvnet.hudson.test.MockAuthorizationStrategy; import org.jvnet.hudson.test.junit.jupiter.WithJenkins; @WithJenkins class JsonAPITest { private static final String GET_API_URL = "custom-api/get-example-param?paramValue=hello"; @Test void testGetJSON(JenkinsRule j) throws Exception { JenkinsRule.WebClient webClient = j.createWebClient(); JSONWebResponse response = webClient.getJSON(GET_API_URL); assertThat(response.getContentAsString(), Matchers.containsString("I am Jenkins hello")); assertThat(response.getStatusCode(), Matchers.equalTo(200)); } @Test void testAdvancedGetJSON(JenkinsRule j) throws Exception { //Given a Jenkins setup with a user "admin" MockAuthorizationStrategy auth = new MockAuthorizationStrategy() .grant(Jenkins.ADMINISTER).everywhere().to("admin"); j.jenkins.setSecurityRealm(j.createDummySecurityRealm()); j.jenkins.setAuthorizationStrategy(auth); //We need to setup the WebClient, we use it to call the HTTP API JenkinsRule.WebClient webClient = j.createWebClient(); //By default if the status code is not ok, WebClient throw an exception //Since we want to assert the error status code, we need to set to false. webClient.setThrowExceptionOnFailingStatusCode(false); // - simple call without authentication should be forbidden JSONWebResponse response = webClient.getJSON(GET_API_URL); assertThat(response.getStatusCode(), Matchers.equalTo(403)); // - same call but authenticated using withBasicApiToken() should be fine response = webClient.withBasicApiToken("admin").getJSON(GET_API_URL); assertThat(response.getStatusCode(), Matchers.equalTo(200)); } } ``` -------------------------------- ### ontrackProjectSetup Source: https://www.jenkins.io/doc/pipeline/steps/ontrack Sets up an Ontrack project, creating it if it does not exist. ```APIDOC ## ontrackProjectSetup ### Description Setup an Ontrack project, and creates it if it does not exist. ### Parameters #### Path Parameters - **project** (String) - Required - The name of the Ontrack project. - **script** (String) - Required - The script to execute for setup. #### Optional Parameters - **bindings** (java.util.Map) - Optional - Bindings for the script. - **logging** (boolean) - Optional - Whether to enable logging. ``` -------------------------------- ### Getting values of other fields Source: https://www.jenkins.io/doc/developer/forms/form-validation Example of a validation method that retrieves values from other input fields using @QueryParameter. ```java public FormValidation doCheckThreads(@QueryParameter String value, @QueryParameter String cpu) { try { int t = Integer.parseInt(value); int c = Integer.parseInt(cpu); if (t*c>10) { return FormValidation.warning("That's asking for too much"); } else { return FormValidation.ok(); } } catch (NumberFormatException e) { return FormValidation.error("Not a number"); } } ``` ```xml ``` -------------------------------- ### Get test.guide Server Source: https://www.jenkins.io/doc/pipeline/steps/ecutest Retrieves a test.guide server instance by name. Allows overriding existing settings for server URL, HTTPS usage, and upload authentication. ```groovy ATX.server('test.guide') ``` ```groovy ATX.server atxName: 'test.guide' ``` ```groovy def server ATX.server atxName: 'test.guide' server.getSetting('serverURL') server.getSettings() server.overrideSetting('uploadToServer', true) server.overrideSettings([serverURL: 'localhost', useHttpsConnection: true]) ``` -------------------------------- ### Anka Node Conflict Regular Expression Example Source: https://www.jenkins.io/doc/pipeline/steps/anka-build This example demonstrates how to use a negative look-ahead in a regular expression to define node conflicts, preventing a node from starting if another specific node is online. This is useful for co-locating build environments. ```regex "^(?!myServer$)(.*erver.*)$" ``` -------------------------------- ### Create new ATX server with full parameters Source: https://www.jenkins.io/doc/pipeline/steps/ecutest Use this method to create a new dynamic test server instance with explicit server URL, upload settings, and project ID. ```groovy ATX.newServer('test.guide', 'ecu.test', 'http://localhost:8085', false, '', '1') ``` -------------------------------- ### startTorqueSandboxEnvironment Source: https://www.jenkins.io/doc/pipeline/steps/quali-torque Starts a sandbox environment with specified parameters including blueprint, name, duration, artifacts, and inputs. ```APIDOC ## startTorqueSandboxEnvironment: "Start Environment" ### Description Start sandbox ### Parameters #### Path Parameters - **spaceName** (String) - Required - Space name. - **blueprint** (String) - Required - The blueprint name. - **sandboxName** (String) - Required - Sandbox name. - **duration** (String) - Optional - Set the duration (ISO 8601), after which Torque will stop the deployment. - **artifacts** (java.util.Map) - Optional - The artifacts map. - **inputs** (java.util.Map) - Optional - User inputs. ``` -------------------------------- ### Testing with CURL Source: https://www.jenkins.io/doc/developer/handling-requests/json Example of how to test the Jenkins GET endpoint using cURL. ```bash curl -XGET \ -w "\n STATUS:%{http_code}" \ http://localhost:8080/jenkins/custom-api/get-example-param?paramValue=hello {"message":"I am Jenkins hello"} STATUS:200 ``` -------------------------------- ### ontrackBranchSetup Source: https://www.jenkins.io/doc/pipeline/steps/ontrack Sets up an Ontrack branch, creating it if it does not exist. ```APIDOC ## ontrackBranchSetup ### Description Setup an Ontrack branch, and creates it if it does not exist. ### Parameters #### Path Parameters - **project** (String) - Required - The name of the Ontrack project. - **branch** (String) - Required - The name of the branch to set up. - **script** (String) - Required - The script to execute for setup. #### Optional Parameters - **bindings** (java.util.Map) - Optional - Bindings for the script. - **logging** (boolean) - Optional - Whether to enable logging. ``` -------------------------------- ### ServiceNow DevOps - Get Change Number Example Source: https://www.jenkins.io/doc/pipeline/steps/servicenow-devops Provides an example JSON payload for the snDevOpsGetChangeNumber step to retrieve a DevOps change request number. Ensure all mandatory fields like pipeline name, build number, and stage name are provided. ```JSON { "pipeline_name": "Test Pipeline", "build_number": "1", "stage_name": "ChangeStage", "branch_name": "master" } ```