Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 31 Next »

The following steps describe the requirements to report an integration build using the Java or NodeJS build scanner.

As a pre-requisite, each component needs to be built, scanned, and reported to SeaLights before reporting the integration build itself.

Create an Integration Build Session ID

Each integration build gets reported as a new build to Sealights, and therefore needs a new session ID of its own.

Java Agent

java -jar sl-build-scanner.jar -config -tokenfile /path/to/sltoken.txt -appname "IntegrationBuildName" -branchname "master" -buildname "1" -pi "*integration.build*" -buildSessionIdFile integrationBSID.txt

Nodejs Agent

Unix

./node_modules/.bin/slnodejs config --tokenfile /path/to/sltoken.txt --appname "IntegrationBuildName" --branch "master" --build "1"
mv buildSessionId integrationBSID.txt

Windows

call .\node_modules\.bin\slnodejs config --tokenfile \path\to\sltoken.txt --appname "IntegrationBuildName" --branch "master" --build "1"
ren buildSessionId integrationBSID.txt

Please notice that for clarity, we have changed the default file name of the Build Session ID to integrationBSID.txt (instead of default buildSessionId.txt in Java or buildSessionId in slnodejs)

Create a Components JSON File

Create a dependencies file using one of the formats available below. You can name this file sl-integration-components.json for example.

Using the app/branch/build format for every component

Using the buildSessionId format for every component

[
	{
		"appName": "sl-sample-backend",
		"branch": "master",
		"build": "1.0.1_233"
	},
	{
		"appName": "sl-sample-frontend",
		"branch": "master",
		"build": "1.2.2_44"
	}
]
[
	{
		"buildSessionId": "123456789"
	},
	{
		"buildSessionId": "abcdefghi"
	}
]

The components listed in the dependencies file must be referring to builds already reported to Sealights (including the Build Scan step) using exact same appName/branchName/buildName parameters reported.

Adding comments to the JSON file with components' BSID only

The JSON file format does not currently support comments.
In order to assist CI job troubleshooting, when reporting a large number of components using the BSID only method, an arbitrary field can be added which serves as a component name comment e.g.

[
	{
		"component_name": "sample-frontend",
		"buildSessionId": "123456789"
	},
	{
		"component_name": "sample-backend",
		"buildSessionId": "abcdefghi"
	}
]

Note that the keywords "appName", "branch" and "build" are reserved and cannot be used as the additional field name.

Report the Integration Build to the Dashboard via the Build Scanner

Run the build scanner referencing the dependencies file created in the previous step and that we have named sl-integration-components.json

Java Agent

java -jar sl-build-scanner.jar -scan -tokenfile sltoken.txt -buildsessionidfile integrationBSID.txt -componentfile sl-integration-components.json

Nodejs Agent

Unix

./node_modules/.bin/slnodejs build --tokenfile sltoken.txt --buildsessionidfile integrationBSID.txt --dependenciesFile sl-integration-components.json

Windows

call .\node_modules\.bin\slnodejs build --tokenfile sltoken.txt --buildsessionidfile integrationBSID.txt --dependenciesFile sl-integration-components.json

Once this has run, all components listed in the dependencies file will be added to the newly created integration build.

Once the integration build has been created, it is possible to run cross-component integration tests, referencing the same session ID created in step #1.

  • No labels