...
Code Block |
---|
"gradleProjectConfig": {"repoConfig": "maven{\nurl \"https://artifactory.company.com/artifactory/remote-repos\"\ncredentials {\nusername = \"USERNAME\"\npassword = \"PASSWORD\"\n}\n}"} |
...
Samples
Table of Contents |
---|
minLevel | 2 |
---|
maxLevel | 6 |
---|
outline | false |
---|
type | list |
---|
printable | false |
---|
|
Shell scriptÂ
Info |
---|
This script is very often added to a new pre-build step in your CI configuration (i.e. Jenkins). |
...
Next step is to run your regular Gradle build command, e.g. gradle clean build.
Gitlab YML
Info |
---|
In the example below: Make sure you have defined a $SEALIGHTS_AGENT_TOKEN masked variable in your Gitlab settings with a value from your Account’s settings page (Agent Token section). You have updated the packagesincluded value defined at line 16 to the relevant one form your repository.
|
Code Block |
---|
|
build:
stage: build
before_script:
- echo "Downloading Sealights Agents..."
- wget -nv https://agents.sealights.co/sealights-java/sealights-java-latest.zip
- unzip -o sealights-java-latest.zip
- echo "Sealights agent version used is:" `cat sealights-java-version.txt`
- >
echo '{
"executionType":"scanonly",
"token":"'$SEALIGHTS_AGENT_TOKEN'",
"createBuildSessionId":true,
"appName":"'$CI_PROJECT_NAME'",
"branchName":"'$CI_COMMIT_BRANCH'",
"buildName":"'$CI_PIPELINE_ID - $CI_JOB_STARTED_AT'",
"packagesIncluded":"*com.mycompany.*",
"sealightsJvmParams": {
"sl.scm.provider": "gitlab",
"sl.scm.baseUrl": "'${CI_SERVER_URL}/${CI_PROJECT_PATH}'/blob" }
}' > sl-plugin-settings.json
- cat sl-plugin-settings.json
- echo "Updating $SL_CMD with Sealights..."
- java -jar sl-build-scanner.jar -gradle -configfile sl-plugin-settings.json -workspacepath . |
The rest of your pipeline is unchanged.