SeaLights Jenkins plugin - Generating a session ID

Before running the build scan and tests, you need to create a session ID. The session ID is provided to each step in order link them together as one complete cycle.

Installation

First install and set up the Jenkins plugin,Ā See 'SeaLights Jenkins plugin - Installation and setup' for details

Generating a session ID

Freestyle Project

  • Open your Freestyle Project job
  • In theĀ BuildĀ section, clickĀ Add build step, and selectĀ SeaLights CLI

Configuring SeaLights CLI to generate the session ID

  • In the Action selectĀ Config - Create build session data
  • If you are building a Java project, then open theĀ AddĀ drop down and select Java Options
    • In theĀ Monitored Application PackagesĀ enter the list of packages that you want SeaLights to analyze. It should be a comma separated list with asterisks before and after each entry

  • Enter the App Name as you want it to be displayed in the SeaLights dashboard. The default isĀ ${JOB_NAME} for the Jenkins job name

  • Enter theĀ Branch Name you are working on and want to display in the SeaLights dashboard. The default isĀ ${GIT_BRANCH} for the branch used with a git SCM

  • Select the Build Name that you want Ā to have for each build and which will be displayed on the SeaLights dashboard

    For descriptions of each of the available options, see Jenkins Plugin Parameters


Using the session ID

The SeaLights CLI config step generates the session ID and places it a buildSessionId.txtĀ  in the jobs workspace.

It also creates two parameters which can be used in following build steps:

  • SL_BUILD_SESSION_ID - contains the session ID itself
  • SL_BUILD_SESSION_ID_FILE - contains the full path to the buildSessionId.txt in the jobs workspace

Using tokens

This step will also expose a new parameter called SL_TOKENĀ containing the token entered in the global configuration of the plugin in Manage Jenkins > Configure System section.

This is to allow you have the token when running our agents using the default command line steps.

If you do not create the Build Session ID via the Sealights Jenkins Plugin, the SL_TOKEN parameter will not be available for next steps of your job.