Per-Component Update/Delete (Java/Node.js)
The following steps describe the requirements to report an integration build using the Java agent or Node.js agent per component as they are updated or deleted
Report a session ID
Each integration build gets reported as a new build to Sealights, and therefore needs a new session ID of its own:
For Java Generating a session ID
for Node.js Generating a session ID
Please notice in this documentation page, we refer to the file containing the build Session-Id for the Integration Build as named as integrationBSID.txt
instead of its default name produced by the agent (buildSessionId.txt
in Java and buildSessionId
in NodeJS).
Adding a new component or updating a new one
The same command is used for both adding and updating components in the integration build. If a component is encountered for the first time it is added to the existing ones, and if it already exists, then it is updated with the new build name. You can report this either by providing the session ID of the components in the command line itself or by providing a JSON array in a file with the session ID's or app/branch/build details of one or more components.
Samples using the -componentids option for Java or Node JS
java -jar sl-build-scanner.jar -componentUpdate -tokenfile sltoken.txt -buildsessionidfile integrationBSID.txt -componentids <component_bsid>
Samples using the -componentfile option for Java or Node JS
java -jar sl-build-scanner.jar -componentUpdate -tokenfile sltoken.txt -buildsessionidfile integrationBSID.txt -componentfile <JSON_dependencies_file_path_and_filename>
The JSON array file should be in one of the following formats:
[{"appName":"<app_name>","branch":"<branch_name>","build":"<build_name>"},{...}]
All the components being updated/deleted must be referring to builds already reported to Sealights (including the Build Scan step) using exact same appName/branchName/buildName or BSID parameters reported
Deleting a component
If you no longer use a component in your environment and want to remove it from the integration build, you will need to specifically update that a component was deleted as Sealights assumes a component not reported is just not updated.
Like with the update command above, you can do so by providing the session ID of the components in the command line itself or by providing a JSON array in a file with the session IDs or app/branch/build details of one or more components.
The only difference is using the componentDelete
instead of the componentUpdate
option.
Note that deleting components can not be performed on the same build components were updated. You must perform this on a new build.
java -jar sl-build-scanner.jar -componentDelete -tokenfile sltoken.txt -buildsessionidfile integrationBSID.txt -componentids <component_bsid>
Last updated
Was this helpful?