Skip to content

Calling the Squash Orchestrator from a Jenkins pipeline

Configuring a Squash Orchestrator in Jenkins

To access the configuration of the Squash Orchestrator, you first need to go the Configure System page accessible in the System Configuration space of Jenkins, through the Manage Jenkins tab :

jenkins-system-configuration

A panel named Squash Orchestrator servers will then be available :

jenkins-orchestrator-server

  • Server id : This ID is automatically generated and can't be modified. It is not used by the user.

  • Server name : This name is defined by the user. It is the one that will be mentioned in the pipeline script of the workflow to be executed.

  • Receptionist endpoint URL : The address of the receptionist micro-service of the orchestrator, with its port as defined at the launch of the orchestrator. Please refer to the Squash Orchestrator documentation for further details.

  • Workflow Status endpoint URL : The address of the observer micro-service of the orchestrator, with its port as defined at the launch of the orchestrator. Please refer to the Squash Orchestrator documentation for further details.

  • Credential : Secret text type Jenkins credential containing a JWT Token allowing authentication to the orchestrator. Please refer to the Squash Orchestrator documentation for further details on secure access to the orchestrator.

  • Workflow Status poll interval : This parameter sets the interval between each update of the workflow status.

  • Workflow creation timeout : Timeout on the reception of the EPAC by the receptionist on the orchestrator side.

Call to the Squash Orchestrator from a Jenkins pipeline

Once there is at least one Squash Orchestrator configured in Jenkins, it is possible to call the Squash Orchestrator from a pipeline type job in Jenkins thanks to a dedicated pipeline method.

Below is an example of a simple pipeline using the calling method to the orchestrator :

node {
   stage 'Stage 1 : sanity check'
   echo 'OK pipelines work in the test instance'
   stage 'Stage 2 : steps check'
   configFileProvider([configFile(
fileId: '600492a8-8312-44dc-ac18-b5d6d30857b4',
targetLocation: 'testWorkflow.json'
)]) {
    def workflow_id = runSquashWorkflow(
        workflowPathName:'testWorkflow.json',
        workflowTimeout: '20S',
        serverName:'defaultServer'
    )
    echo "We just ran The Squash Orchestrator workflow $workflow_id"
   }
}

The runSquashWorkflow method allows the transmission of an EPAC to the orchestrator for an execution.

It uses 3 parameters :

  • workflowPathName : The path to the file containing the EPAC. In the present case, the file is injected through the Config File Provider plugin, but it is also possible to get it through other means (retrieval from a SCM, on the fly generation in a file, ...).

  • workflowTimeout : Timeout on the actions execution. This timeout will be activated for example if an environment is unreachable (or doesn't exist), or if an action is not found by an actionProvider. It is to be adapted depending on the expected duration of the execution of the various tests in the EPAC.

  • serverName : Name of the Squash Orchestrator server to use. This name is defined in the Squash Orchestrator servers space of the Jenkins configuration.

Back to top